diff options
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/extra/rebootfw | 18 | ||||
| -rwxr-xr-x | bin/menuscripts/mpower | 29 | 
2 files changed, 31 insertions, 16 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 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   | 
