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