mirror of
https://github.com/pi-hole/pi-hole
synced 2025-02-22 21:12:01 +00:00
Allow force-reload to be used when restarting DNS
* Remove duplicate coltable variable definition and source * Minor comment modifications * Add "$2" to restartdns
This commit is contained in:
parent
a5c4ae955a
commit
4d39ab9753
11
pihole
11
pihole
@ -12,10 +12,6 @@
|
|||||||
readonly PI_HOLE_SCRIPT_DIR="/opt/pihole"
|
readonly PI_HOLE_SCRIPT_DIR="/opt/pihole"
|
||||||
readonly wildcardlist="/etc/dnsmasq.d/03-pihole-wildcard.conf"
|
readonly wildcardlist="/etc/dnsmasq.d/03-pihole-wildcard.conf"
|
||||||
readonly colfile="${PI_HOLE_SCRIPT_DIR}/COL_TABLE"
|
readonly colfile="${PI_HOLE_SCRIPT_DIR}/COL_TABLE"
|
||||||
|
|
||||||
source ${colfile}
|
|
||||||
|
|
||||||
colfile="${PI_HOLE_SCRIPT_DIR}/COL_TABLE"
|
|
||||||
source "${colfile}"
|
source "${colfile}"
|
||||||
|
|
||||||
# Must be root to use this tool
|
# Must be root to use this tool
|
||||||
@ -354,8 +350,9 @@ restartDNS() {
|
|||||||
local svcOption svc str output status
|
local svcOption svc str output status
|
||||||
svcOption="${1:-}"
|
svcOption="${1:-}"
|
||||||
|
|
||||||
|
# Determine if we should reload or restart dnsmasq
|
||||||
if [[ "${svcOption}" =~ "reload" ]]; then
|
if [[ "${svcOption}" =~ "reload" ]]; then
|
||||||
# SIGHUP does NOT re-read any *.conf files
|
# Using SIGHUP will NOT re-read any *.conf files
|
||||||
svc="killall -s SIGHUP dnsmasq"
|
svc="killall -s SIGHUP dnsmasq"
|
||||||
elif [[ -z "${svcOption}" ]]; then
|
elif [[ -z "${svcOption}" ]]; then
|
||||||
# Get PID of dnsmasq to determine if it needs to start or restart
|
# Get PID of dnsmasq to determine if it needs to start or restart
|
||||||
@ -367,7 +364,7 @@ restartDNS() {
|
|||||||
svc="service dnsmasq ${svcOption}"
|
svc="service dnsmasq ${svcOption}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Print output to Terminal, not Web Admin
|
# Print output to Terminal, but not to Web Admin
|
||||||
str="${svcOption^}ing DNS service"
|
str="${svcOption^}ing DNS service"
|
||||||
[[ -t 1 ]] && echo -ne " ${INFO} ${str}..."
|
[[ -t 1 ]] && echo -ne " ${INFO} ${str}..."
|
||||||
|
|
||||||
@ -659,7 +656,7 @@ case "${1}" in
|
|||||||
"enable" ) piholeEnable 1;;
|
"enable" ) piholeEnable 1;;
|
||||||
"disable" ) piholeEnable 0 "$2";;
|
"disable" ) piholeEnable 0 "$2";;
|
||||||
"status" ) statusFunc "$2";;
|
"status" ) statusFunc "$2";;
|
||||||
"restartdns" ) restartDNS;;
|
"restartdns" ) restartDNS "$2";;
|
||||||
"-a" | "admin" ) webpageFunc "$@";;
|
"-a" | "admin" ) webpageFunc "$@";;
|
||||||
"-t" | "tail" ) tailFunc;;
|
"-t" | "tail" ) tailFunc;;
|
||||||
"checkout" ) piholeCheckoutFunc "$@";;
|
"checkout" ) piholeCheckoutFunc "$@";;
|
||||||
|
Loading…
Reference in New Issue
Block a user