Skip to content

Instantly share code, notes, and snippets.

@jiripudil
Created October 16, 2013 11:10
Show Gist options
  • Save jiripudil/7006132 to your computer and use it in GitHub Desktop.
Save jiripudil/7006132 to your computer and use it in GitHub Desktop.
A script that comes in handy when you are dealing with Unix problems and you get desperate.
#!/bin/sh
if [ -z $1 ]; then
echo "Don't swear!" # or similar motivating phrase
exit 2
fi
case $1 in
you)
sudo reboot
;;
off)
sudo poweroff
;;
*)
echo "Usage: $0 [you|off]"
exit 1
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment