#!/mod/bin/jimsh
package require cgi
source /mod/var/mongoose/lib/setup
require rsv.class
puts "Content-Type: text/html"
puts ""
cgi_input
if {[cgi_get now] eq "yes"} {
# - Busybox reboot does sync the disk but may still not be clean enough.
puts "Restarting."
exec /etc/init.d/S90settop shut
exec /sbin/reboot
exit
}
file delete /tmp/.restartpending
header
# Commit pending reservations.
rsv commit
puts {
Please wait while the Humax restarts...