mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 12:40:56 +00:00
Backup existing /etc/dnsmasq.conf if present and ensure that /etc/dnsmasq.conf contains only "conf-dir=/etc/dnsmasq.d"
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
6c97b8b875
commit
28c6b1393f
@ -2109,12 +2109,14 @@ FTLinstall() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#ensure /etc/dnsmasq.conf contains `conf-dir=/etc/dnsmasq.d`
|
# Backup existing /etc/dnsmasq.conf if present and ensure that
|
||||||
confdir="conf-dir=/etc/dnsmasq.d"
|
# /etc/dnsmasq.conf contains only "conf-dir=/etc/dnsmasq.d"
|
||||||
conffile="/etc/dnsmasq.conf"
|
local conffile="/etc/dnsmasq.conf"
|
||||||
if ! grep -q "$confdir" "$conffile"; then
|
if [[ -f "${conffile}" ]]; then
|
||||||
echo "$confdir" >> "$conffile"
|
mv "${conffile}" "${conffile}.old"
|
||||||
fi
|
fi
|
||||||
|
# Create /etc/dnsmasq.conf
|
||||||
|
echo "conf-dir=/etc/dnsmasq.d" > "${conffile}"
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
# Otherwise,
|
# Otherwise,
|
||||||
|
Loading…
Reference in New Issue
Block a user