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]}"
|
change_setting "API_EXCLUDE_CLIENTS" "${args[2]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Poweroff(){
|
||||||
|
nohup bash -c "sleep 5; poweroff" &> /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 &
|
||||||
}
|
}
|
||||||
@ -230,7 +234,7 @@ RestartDNS() {
|
|||||||
output=$( { service dnsmasq restart; } 2>&1 )
|
output=$( { service dnsmasq restart; } 2>&1 )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${output}" ]]; then
|
if [[ -z "${output}" ]]; then
|
||||||
[[ -t 1 ]] && echo -e "${OVER} ${TICK} ${str}"
|
[[ -t 1 ]] && echo -e "${OVER} ${TICK} ${str}"
|
||||||
else
|
else
|
||||||
[[ ! -t 1 ]] && OVER=""
|
[[ ! -t 1 ]] && OVER=""
|
||||||
@ -480,6 +484,7 @@ main() {
|
|||||||
"setdns" ) SetDNSServers;;
|
"setdns" ) SetDNSServers;;
|
||||||
"setexcludedomains" ) SetExcludeDomains;;
|
"setexcludedomains" ) SetExcludeDomains;;
|
||||||
"setexcludeclients" ) SetExcludeClients;;
|
"setexcludeclients" ) SetExcludeClients;;
|
||||||
|
"poweroff" ) Poweroff;;
|
||||||
"reboot" ) Reboot;;
|
"reboot" ) Reboot;;
|
||||||
"restartdns" ) RestartDNS;;
|
"restartdns" ) RestartDNS;;
|
||||||
"setquerylog" ) SetQueryLogOptions;;
|
"setquerylog" ) SetQueryLogOptions;;
|
||||||
|
Loading…
Reference in New Issue
Block a user