|
|
|
@ -14,6 +14,8 @@ readonly wildcardlist="/etc/dnsmasq.d/03-pihole-wildcard.conf"
|
|
|
|
|
readonly colfile="${PI_HOLE_SCRIPT_DIR}/COL_TABLE"
|
|
|
|
|
source "${colfile}"
|
|
|
|
|
|
|
|
|
|
resolver="pihole-FTL"
|
|
|
|
|
|
|
|
|
|
# Must be root to use this tool
|
|
|
|
|
if [[ ! $EUID -eq 0 ]];then
|
|
|
|
|
if [[ -x "$(command -v sudo)" ]]; then
|
|
|
|
@ -332,18 +334,18 @@ restartDNS() {
|
|
|
|
|
local svcOption svc str output status
|
|
|
|
|
svcOption="${1:-}"
|
|
|
|
|
|
|
|
|
|
# Determine if we should reload or restart dnsmasq
|
|
|
|
|
# Determine if we should reload or restart restart
|
|
|
|
|
if [[ "${svcOption}" =~ "reload" ]]; then
|
|
|
|
|
# Using SIGHUP will NOT re-read any *.conf files
|
|
|
|
|
svc="killall -s SIGHUP dnsmasq"
|
|
|
|
|
svc="killall -s SIGHUP \"${resolver}\""
|
|
|
|
|
else
|
|
|
|
|
# Get PID of dnsmasq to determine if it needs to start or restart
|
|
|
|
|
# Get PID of resolver to determine if it needs to start or restart
|
|
|
|
|
if pidof dnsmasq &> /dev/null; then
|
|
|
|
|
svcOption="restart"
|
|
|
|
|
else
|
|
|
|
|
svcOption="start"
|
|
|
|
|
fi
|
|
|
|
|
svc="service dnsmasq ${svcOption}"
|
|
|
|
|
svc="service \"${resolver}\" ${svcOption}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Print output to Terminal, but not to Web Admin
|
|
|
|
@ -359,9 +361,6 @@ restartDNS() {
|
|
|
|
|
[[ ! -t 1 ]] && local OVER=""
|
|
|
|
|
echo -e "${OVER} ${CROSS} ${output}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Send signal to FTL to have it re-parse the gravity files
|
|
|
|
|
killall -s SIGHUP pihole-FTL
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
piholeEnable() {
|
|
|
|
|