webif/var/mongoose/include/restart.jim
hummypkg 1984d7151b restructure restartpending, create folder, cancel restartpending once nothing pending
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1784 2a923420-c742-0410-a762-8d5b09965624
2014-02-10 23:03:36 +00:00

62 lines
1.4 KiB
Plaintext
Executable File

#!/mod/bin/jimsh
source /mod/webif/lib/setup
if {[file exists /tmp/.restartpending]} {
require system.class rsv.class
if {[rsv count pending] > 0} {
puts {
<center>
<div style="width: 100%; height: 0.7em;
background: url(/img/stripes.gif) repeat-x;"></div>
<div style="font-size: 1.2em; width: 60%; text-align: center; padding: 0.5em">
A restart is required in order to complete a scheduling operation.
<br>
<font class=blood>
}
if {[system busy]} {
puts "Cannot restart whilst box is busy."
} else {
puts {
Restart via the remote control or
<small><button id=restart_humaxtv>Restart now</button></small>
}
}
puts {
<small><button id=restart_cancel>Dismiss</button></small>
</font>
</div>
<div style="width: 100%; height: 0.7em;
background: url(/img/stripes.gif) repeat-x;"></div>
</center>
<script type=text/javascript>
$('#restart_humaxtv').button()
.click(function() {
if (confirm('Are you sure you wish to perform a restart now?'))
if (confirm('Really sure?\n\nThere is a small chance the ' +
' Humax may not restart\n' +
'without physical intervention.\n\n' +
'i.e. pressing the standby button or using the ' +
'remote control'))
window.location = '/cgi-bin/restart.jim';
});
$('#restart_cancel').button()
.click(function() {
$.get('/cgi-bin/restart.jim?act=cancel');
$('#restart_block').slideUp('slow');
});
</script>
}
} else {
system restartpending 0
}
}