Add "system isrestartpending"

This commit is contained in:
prpr 2022-12-27 17:02:23 +00:00
parent aa24f100fa
commit 30a006b971
2 changed files with 8 additions and 3 deletions

View File

@ -1,9 +1,10 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
require system.class
set class "class=hidden"
if {[file exists /tmp/.restartpending]} {
source /mod/webif/lib/setup
require system.class rsv.class
if {[system isrestartpending]} {
require rsv.class
if {[rsv count pending] <= 0} {
system restartpending 0
} else {

View File

@ -554,6 +554,10 @@ proc {system reboot} {{fast 0}} {
}
}
proc {system isrestartpending} {} {
return [file exists /tmp/.restartpending]
}
proc {system restartpending} {{mode 1}} {
if {$mode} {
close [open /tmp/.restartpending w]