new script: sane-reboot, to prevent me from rebooting the wrong machine when working with multiple hosts

This commit is contained in:
colin 2022-11-03 00:59:59 -07:00
parent 730fa8ba4b
commit 14b334ff55
2 changed files with 13 additions and 0 deletions

View File

@ -25,6 +25,7 @@ resholve.mkDerivation {
gnugrep
gocryptfs
ifuse
inetutils
inotify-tools
ncurses
oath-toolkit

View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
target="$1"
host="$(hostname)"
if [ "$host" = "$target" ]
then
sudo reboot now
else
echo "WRONG MACHINE. you're on $host."
exit 1
fi