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