shutdown script using xmessage or zenity
Thursday, 5. October 2006, 10:43:19
Uses xmessage
Uses zenity
#!/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














How to use Quote function: