new script: sane-shutdown, validates host
This commit is contained in:
12
pkgs/sane-scripts/src/sane-shutdown
Executable file
12
pkgs/sane-scripts/src/sane-shutdown
Executable 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
|
||||||
|
|
Reference in New Issue
Block a user