summaryrefslogtreecommitdiff
path: root/bin/extra
diff options
context:
space:
mode:
authorRaymaekers Luca <luca@spacehb.net>2025-03-29 16:19:02 +0100
committerRaymaekers Luca <luca@spacehb.net>2025-03-29 16:19:48 +0100
commite2ced9d14c8ffbaa0a6d42f0f0aff6e0e2aeab98 (patch)
treeaa1ff5c666f1b1a0914d651b0301565f5eca71aa /bin/extra
parent8ce0700f526e1292f266ecc5e744dd69d763c6e0 (diff)
checkpoint
Diffstat (limited to 'bin/extra')
-rwxr-xr-xbin/extra/rebootfw18
1 files changed, 14 insertions, 4 deletions
diff --git a/bin/extra/rebootfw b/bin/extra/rebootfw
index 53c6c00..8288c1a 100755
--- a/bin/extra/rebootfw
+++ b/bin/extra/rebootfw
@@ -1,11 +1,21 @@
#!/bin/sh
-printf "\x7\x0\x0\x0\x1\x0\x0\x0\x0\x0\x0\x0" |
- doas tee "/sys/firmware/efi/efivars/OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c"
+printf '\x7\x0\x0\x0\x1\x0\x0\x0\x0\x0\x0\x0' | doas tee '/sys/firmware/efi/efivars/OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c'
if [ "$(hostname)" = "spring" ]
then
- doas /usr/sbin/reboot
+ if [ "$1" = "hibernate" ]
+ then
+ doas /usr/sbin/zzz -R
+ else
+ doas /usr/sbin/reboot
+ fi
else
- reboot
+ if [ "$1" = "hibernate" ]
+ then
+ systemctl hibernate
+
+ else
+ reboot
+ fi
fi