Sure, the script is:
echo "Warning: Utility power failure has occurred for a few seconds, system will be shutdown soon!" | wall
gksu -u shawn -l -d -w vboxmanage controlvm "Windows XP" savestate
#vboxmanage controlvm "Windows XP" savestate
# If you want to receive event notification by e-mail, you must change 'ENABLE_EMAIL' item to 'yes'.
# Note: After change 'ENABLE_EMAIL' item, you must asign 'RECEIPT_NAME', 'RECEIPT_ADDRESS', and
# 'SENDER_ADDRESS' three items as below for the correct information.
# Enable to send e-mail
# Change your name at this itme.
# Change mail receiver address at this itme.
# Change mail sender address at this itme.
# Execute the 'pwrstatd-email.sh' shell script
if [ $ENABLE_EMAIL = yes ]; then