Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add web frontend shutdown command #1572

Merged
merged 5 commits into from
Sep 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion advanced/Scripts/webpage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &
}
Expand All @@ -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=""
Expand Down Expand Up @@ -480,6 +484,7 @@ main() {
"setdns" ) SetDNSServers;;
"setexcludedomains" ) SetExcludeDomains;;
"setexcludeclients" ) SetExcludeClients;;
"poweroff" ) Poweroff;;
"reboot" ) Reboot;;
"restartdns" ) RestartDNS;;
"setquerylog" ) SetQueryLogOptions;;
Expand Down