Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- print_usage(){
- echo "Usage: ck-shutdown [OPTION]"
- echo
- echo "Options:"
- echo
- echo " -s, --stop shutdown computer system"
- echo " -r, --restart restart computer system"
- echo " -h, --help print this help"
- echo
- echo "Example:"
- echo
- echo "ck-shutdown --stop"
- }
- stop(){
- dbus-send --system --dest=org.freedesktop.ConsoleKit --type=method_call --print-reply --reply-timeout=2000 /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
- }
- restart(){
- dbus-send --system --dest=org.freedesktop.ConsoleKit --type=method_call --print-reply --reply-timeout=2000 /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
- }
- case $1 in
- -s|--stop) stop;;
- -r|--restart) restart;;
- -h|--help) print_usage;;
- *) print_usage;;
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement