new script: sane-reboot
, to prevent me from rebooting the wrong machine when working with multiple hosts
This commit is contained in:
parent
730fa8ba4b
commit
14b334ff55
|
@ -25,6 +25,7 @@ resholve.mkDerivation {
|
|||
gnugrep
|
||||
gocryptfs
|
||||
ifuse
|
||||
inetutils
|
||||
inotify-tools
|
||||
ncurses
|
||||
oath-toolkit
|
||||
|
|
12
pkgs/sane-scripts/src/sane-reboot
Executable file
12
pkgs/sane-scripts/src/sane-reboot
Executable 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
|
||||
|
Loading…
Reference in New Issue
Block a user