2011-07-08 20:39:57 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
2011-08-22 20:55:06 +00:00
|
|
|
package require cgi
|
|
|
|
source /mod/var/mongoose/lib/setup
|
2011-09-02 19:50:10 +00:00
|
|
|
require rsv.class system.class
|
2011-08-22 20:55:06 +00:00
|
|
|
|
2011-07-08 20:39:57 +00:00
|
|
|
puts "Content-Type: text/html"
|
|
|
|
puts ""
|
|
|
|
|
2011-08-22 20:55:06 +00:00
|
|
|
cgi_input
|
2012-01-05 22:42:45 +00:00
|
|
|
|
|
|
|
if {[cgi_get act] eq "cancel"} {
|
|
|
|
file delete /tmp/.restartpending
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
2011-08-22 20:55:06 +00:00
|
|
|
if {[cgi_get now] eq "yes"} {
|
|
|
|
# - Busybox reboot does sync the disk but may still not be clean enough.
|
|
|
|
puts "Restarting."
|
2011-09-02 19:50:10 +00:00
|
|
|
system reboot
|
2011-08-22 20:55:06 +00:00
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
|
|
|
file delete /tmp/.restartpending
|
|
|
|
header
|
|
|
|
|
2011-08-25 20:30:13 +00:00
|
|
|
# Commit pending reservations on older mod versions.
|
|
|
|
if {![file exists /sbin/rsvsync] && ![file exists /mod/boot/rsvsync]} {
|
|
|
|
rsv commit
|
|
|
|
}
|
2011-08-22 20:55:06 +00:00
|
|
|
|
|
|
|
puts {
|
|
|
|
<link href=/css/jquery.progressbar.css rel=stylesheet type=text/css />
|
|
|
|
<script type="text/javascript" src="/js/jquery.progressbar.js"></script>
|
|
|
|
|
|
|
|
<script type=text/javascript>
|
|
|
|
var handle = 0;
|
|
|
|
var pct = 0;
|
|
|
|
function update()
|
|
|
|
{
|
|
|
|
$('#progressbar').reportprogress(++pct);
|
|
|
|
if (pct == 100)
|
|
|
|
{
|
|
|
|
clearInterval(handle);
|
|
|
|
pct = 0;
|
|
|
|
window.location = '/';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('#progressbar').reportprogress(0);
|
|
|
|
handle = setInterval("update()", 300);
|
|
|
|
$.get('/cgi-bin/restart.jim?now=yes');
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
Please wait while the Humax restarts...<br>
|
|
|
|
<div id=progressbar></div>
|
|
|
|
}
|
|
|
|
|
|
|
|
footer
|
2011-07-08 20:39:57 +00:00
|
|
|
|