28 lines
449 B
Text
28 lines
449 B
Text
|
#!/bin/sh
|
||
|
# Nico Schottelius
|
||
|
# shutdown system
|
||
|
# 2005-05-24
|
||
|
|
||
|
|
||
|
usage()
|
||
|
{
|
||
|
echo "`basename $0` -[ohr]"
|
||
|
echo " Shutdown the system:"
|
||
|
echo " -o|--off: Power off"
|
||
|
echo " -h|--halt: Halt"
|
||
|
echo " -r|--reboot: Reboot"
|
||
|
echo " "
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
if [ $# -ne 1 ]; then
|
||
|
usage
|
||
|
fi
|
||
|
|
||
|
case $1 in
|
||
|
-r|--reboot) kill -HUP 1 ;;
|
||
|
-o|--off) kill -TERM 1 ;;
|
||
|
-h|--halt) kill -USR1 1 ;;
|
||
|
*) usage ;;
|
||
|
esac
|