sane-reboot: fix operation on servo

This commit is contained in:
Colin 2024-06-03 09:33:35 +00:00
parent 2d07ff966b
commit 1448cb4444

View File

@ -7,8 +7,10 @@ shift
host="$(hostname)" host="$(hostname)"
if [ "$host" = "$target" ] if [ "$host" = "$target" ]
then then
# N.B.: anything other than just `reboot` with no args requires `sudo` privilegs (to write to /run/systemd/) # N.B.: anything other than just `reboot` with no args requires `sudo` privileges (to write to /run/systemd/).
reboot "$@" # `systemctl reboot -i` tells systemd to ignore inhibitors (i.e. other users logged in).
reboot "$@" || \
systemctl reboot -i "$@"
else else
echo "WRONG MACHINE. you're on $host." echo "WRONG MACHINE. you're on $host."
exit 1 exit 1