From 82fe3d8c3ebb663506a017eabb035fc8946be8c8 Mon Sep 17 00:00:00 2001 From: Cedric Girard Date: Wed, 15 Jun 2011 17:50:09 +0200 Subject: [PATCH] script I use to shutdown/reboot --- code/shutdown-script/shutdown.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 code/shutdown-script/shutdown.sh diff --git a/code/shutdown-script/shutdown.sh b/code/shutdown-script/shutdown.sh new file mode 100755 index 0000000..6c81181 --- /dev/null +++ b/code/shutdown-script/shutdown.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +gxmessage -center -buttons "Cancel:42,Close session:0,Reboot:2,Shutdown:3" -default "Close session" -timeout 60 What do you want ? +retval=$? +if [ $retval -eq 0 ] ; then + pkill xmonad; +elif [ $retval -eq 2 ] ; then + sudo shutdown -r now; +elif [ $retval -eq 3 ] ; then + sudo shutdown -h now +#else + #echo "do nothing"; +fi +