Update webpage.sh

Implement "Halt system" button, next to "Restart system" button, on
admin/settings page.  Useful for doing clean shutdown before powering off.

(This affects 4 files, 3 for the web content, 1 for backend script.)

Gilbert Detillieux <gedetil> 2017-04-11
This commit is contained in:
gedetil 2017-04-11 12:04:44 -05:00 committed by GitHub
parent 1d64b614c7
commit ff6df76e36

View file

@ -211,6 +211,10 @@ SetExcludeClients(){
} }
Halt(){
nohup bash -c "sleep 5; halt" &> /dev/null </dev/null &
}
Reboot(){ Reboot(){
nohup bash -c "sleep 5; reboot" &> /dev/null </dev/null & nohup bash -c "sleep 5; reboot" &> /dev/null </dev/null &
@ -456,6 +460,7 @@ main() {
"setdns" ) SetDNSServers;; "setdns" ) SetDNSServers;;
"setexcludedomains" ) SetExcludeDomains;; "setexcludedomains" ) SetExcludeDomains;;
"setexcludeclients" ) SetExcludeClients;; "setexcludeclients" ) SetExcludeClients;;
"halt" ) Halt;;
"reboot" ) Reboot;; "reboot" ) Reboot;;
"restartdns" ) RestartDNS;; "restartdns" ) RestartDNS;;
"setquerylog" ) SetQueryLogOptions;; "setquerylog" ) SetQueryLogOptions;;