webif/webif/include/restart.jim

37 lines
746 B
Tcl
Executable File

#!/mod/bin/jimsh
set class "class=hidden"
if {[file exists /tmp/.restartpending]} {
source /mod/webif/lib/setup
require system.class rsv.class
if {[rsv count pending] <= 0} {
system restartpending 0
} else {
set class ""
}
}
puts "<div id=restart_block $class>"
puts {
<div style="width: 100%; height: 0.7em;
background: url(/img/stripes.gif) repeat-x;"></div>
<div>
Restart required.
}
if {[system busy]} {
puts "<div class=blood><i>System busy...</i></div>"
} else {
puts {
<button class=red id=restart_humaxtv>Reboot now</button>
<script type=text/javascript src=/js/restart.js></script>
}
}
puts {
</div>
<div style="width: 100%; height: 0.7em;
background: url(/img/stripes.gif) repeat-x;"></div>
</div>
}