shutdown script using xmessage or zenity
Thursday, October 5, 2006 10:43:19 AM
#!/bin/sh
# Say bye to shutdown your pc
#uses xmessage to ask first.
answer=$(xmessage "Are you sure you want to shutdown? " -buttons yes,no -print)
if [ $answer = "yes" ]
then
# Do shutdown at here.
#Ubuntu probably needs gksudo instead of sudo
sudo init 0;
fi
Uses zenity
#!/bin/sh
# Say bye to shutdown your pc
#uses zenity to ask first.
zenity --question --title "Shutdown Confirmation" \
--text "Are you sure you want to shutdown?"
if [ "$?" -eq "0" ]
then
# Do shutdown at here.
#Ubuntu probably needs gksudo instead of sudo
sudo init 0;
fi














Unregistered user # Sunday, September 19, 2010 5:30:23 AM