mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Use pihole-FTL resolver in pihole and gravity
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
b87bcc8f5f
commit
e8ec0dc701
2 changed files with 10 additions and 9 deletions
|
@ -42,6 +42,8 @@ preEventHorizon="list.preEventHorizon"
|
|||
|
||||
skipDownload="false"
|
||||
|
||||
resolver="pihole-FTL"
|
||||
|
||||
# Source setupVars from install script
|
||||
setupVars="${piholeDir}/setupVars.conf"
|
||||
if [[ -f "${setupVars}" ]];then
|
||||
|
@ -102,7 +104,7 @@ gravity_CheckDNSResolutionAvailable() {
|
|||
fi
|
||||
|
||||
# Determine error output message
|
||||
if pidof dnsmasq &> /dev/null; then
|
||||
if pidof "${resolver}" &> /dev/null; then
|
||||
echo -e " ${CROSS} DNS resolution is currently unavailable"
|
||||
else
|
||||
echo -e " ${CROSS} DNS service is not running"
|
||||
|
@ -560,7 +562,7 @@ gravity_Cleanup() {
|
|||
echo -e "${OVER} ${TICK} ${str}"
|
||||
|
||||
# Only restart DNS service if offline
|
||||
if ! pidof dnsmasq &> /dev/null; then
|
||||
if ! pidof "${resolver}" &> /dev/null; then
|
||||
"${PIHOLE_COMMAND}" restartdns
|
||||
dnsWasOffline=true
|
||||
fi
|
||||
|
|
13
pihole
13
pihole
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue