folder="Mybook"
Scriptname="Reboot_Mybook"
if [ $# -eq "0" ]; then
echo " You are about to reboot Your Mybook"
echo " Be aware that this will terminate all running process immediately "
echo " Some processes may not terminate correctly when rebooting using this interface. "
echo " Use at your own risks... "
echo "
Click Here to reboot "
echo "
"
echo "
Click Here to Shutdown "
FLAG=NOTHING
else
FLAG=$1
fi
if ( [ $FLAG = "WAIT_REBOOT" ] ) ; then
echo "Rebooting Mybook ... : "
echo "
Please Wait until end of reboot/Shutdown ( 1 minute) ... :"
fi
if ( [ $FLAG = "SHUTDOWNCONFIRM" ] ) ; then
echo "Are you sure you WANT to Shutdown? : "
echo "
IT WILL NOT BE POSSIBLE TO Start it up Remotely ! :"
echo "
YES, I Want to Shutdown "
fi
if ( [ $FLAG = "SHUTDOWN_NOW" ] ) ; then
(sleep 3;/sbin/poweroff -f -d 3)&
# Redirect ...
echo -n ""
echo -n ""
echo -n ""
fi
if ( [ $FLAG = "REBOOT_NOW" ] ) ; then
(sleep 3;reboot -f)&
# Redirect ...
echo -n ""
echo -n ""
echo -n ""
fi