diff options
author | Raymaekers Luca <luca@spacehb.net> | 2025-03-29 16:19:02 +0100 |
---|---|---|
committer | Raymaekers Luca <luca@spacehb.net> | 2025-03-29 16:19:48 +0100 |
commit | e2ced9d14c8ffbaa0a6d42f0f0aff6e0e2aeab98 (patch) | |
tree | aa1ff5c666f1b1a0914d651b0301565f5eca71aa /bin/menuscripts/mpower | |
parent | 8ce0700f526e1292f266ecc5e744dd69d763c6e0 (diff) |
checkpoint
Diffstat (limited to 'bin/menuscripts/mpower')
-rwxr-xr-x | bin/menuscripts/mpower | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/bin/menuscripts/mpower b/bin/menuscripts/mpower index fb7249d..93b6c7b 100755 --- a/bin/menuscripts/mpower +++ b/bin/menuscripts/mpower @@ -1,27 +1,32 @@ #!/bin/sh choice="$( -cat <<EOF | commander -c -w 1 -y 5 +cat <<EOF | commander -c -w 1 -y 7 poweroff suspend reboot firmware hibernate +eepy EOF )" if [ "$(hostname)" = "winter" ]; then if [ "$choice" = "firmware" ]; then systemctl reboot --firmware-setup - exit + elif [ "$choice" = "eepy" ]; then + systemctl hybrid-sleep + else + systemctl "$choice" fi - systemctl "$choice" - exit +elif [ "$(hostname)" = "spring" ]; then + case "$choice" in + "suspend") doas /usr/sbin/zzz -z ;; + "hibernate") doas /usr/sbin/zzz -Z ;; + "eepy") doas /usr/sbin/zzz -H ;; + "poweroff") doas /usr/sbin/poweroff ;; + "reboot") doas /usr/sbin/reboot ;; + "firmware") rebootfw ;; + "") exit 1 ;; + *) ;; + esac fi - -case "$choice" in - "suspend") doas /usr/sbin/zzz ;; - "poweroff") doas /usr/sbin/poweroff ;; - "reboot"|"firmware") doas /usr/sbin/reboot ;; - "") exit 1 ;; - *) ;; -esac |