new script: sane-shutdown, validates host

This commit is contained in:
colin 2023-01-06 16:40:41 +00:00
parent 83f416999f
commit 81effb01a3
1 changed files with 12 additions and 0 deletions

View File

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