mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 12:40:56 +00:00
Merge pull request #1572 from pi-hole/gedetil-development
Add web frontend shutdown command
This commit is contained in:
commit
b8fedf76cd
@ -217,6 +217,10 @@ SetExcludeClients() {
|
||||
change_setting "API_EXCLUDE_CLIENTS" "${args[2]}"
|
||||
}
|
||||
|
||||
Poweroff(){
|
||||
nohup bash -c "sleep 5; poweroff" &> /dev/null </dev/null &
|
||||
}
|
||||
|
||||
Reboot() {
|
||||
nohup bash -c "sleep 5; reboot" &> /dev/null </dev/null &
|
||||
}
|
||||
@ -230,7 +234,7 @@ RestartDNS() {
|
||||
output=$( { service dnsmasq restart; } 2>&1 )
|
||||
fi
|
||||
|
||||
if [[ -z "${output}" ]]; then
|
||||
if [[ -z "${output}" ]]; then
|
||||
[[ -t 1 ]] && echo -e "${OVER} ${TICK} ${str}"
|
||||
else
|
||||
[[ ! -t 1 ]] && OVER=""
|
||||
@ -480,6 +484,7 @@ main() {
|
||||
"setdns" ) SetDNSServers;;
|
||||
"setexcludedomains" ) SetExcludeDomains;;
|
||||
"setexcludeclients" ) SetExcludeClients;;
|
||||
"poweroff" ) Poweroff;;
|
||||
"reboot" ) Reboot;;
|
||||
"restartdns" ) RestartDNS;;
|
||||
"setquerylog" ) SetQueryLogOptions;;
|
||||
|
Loading…
Reference in New Issue
Block a user