2011-07-07 22:33:19 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
2011-07-08 20:39:57 +00:00
|
|
|
if {[file exists /tmp/.restartpending]} {
|
2011-07-07 22:33:19 +00:00
|
|
|
|
|
|
|
puts {
|
|
|
|
<center>
|
2011-07-08 20:39:57 +00:00
|
|
|
<div style="width: 60%; height: 0.7em;
|
2011-07-07 22:33:19 +00:00
|
|
|
background: url(/img/stripes.gif) repeat-x;"></div>
|
2011-07-08 20:39:57 +00:00
|
|
|
<div style="font-size: 1.2em; width: 60%; text-align: center; padding: 0.5em">
|
|
|
|
A warm restart is required in order to complete a scheduling operation.
|
|
|
|
<br>
|
|
|
|
<font class=blood>
|
|
|
|
}
|
|
|
|
|
|
|
|
# Is humaxtv doing anything?
|
|
|
|
set pid [exec pgrep humaxtv]
|
|
|
|
set c 0
|
|
|
|
catch { set c [exec /mod/bin/lsof -p $pid | grep Video | fgrep .ts | wc -l] }
|
|
|
|
|
|
|
|
if {$c > 0} {
|
|
|
|
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 {
|
|
|
|
</font>
|
2011-07-07 22:33:19 +00:00
|
|
|
</div>
|
2011-07-08 20:39:57 +00:00
|
|
|
<div style="width: 60%; height: 0.7em; margin-bottom: 2em;
|
2011-07-07 22:33:19 +00:00
|
|
|
background: url(/img/stripes.gif) repeat-x;"></div>
|
|
|
|
</center>
|
2011-07-08 20:39:57 +00:00
|
|
|
<script type=text/javascript>
|
|
|
|
$('#restart_humaxtv').button();
|
|
|
|
$('#restart_humaxtv').click(function() {
|
|
|
|
if (confirm('Are you sure you wish to perform a warm restart now?'))
|
|
|
|
{
|
|
|
|
$.ajax({
|
|
|
|
url: '/cgi-bin/restart.jim',
|
|
|
|
success: function() {
|
|
|
|
window.location.reload(true);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
}
|
|
|
|
|
2011-07-07 22:33:19 +00:00
|
|
|
}
|
|
|
|
|