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>
pull/2381/head
DL6ER 6 years ago
parent 6c97b8b875
commit 28c6b1393f
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD

@ -2109,12 +2109,14 @@ FTLinstall() {
fi
fi
#ensure /etc/dnsmasq.conf contains `conf-dir=/etc/dnsmasq.d`
confdir="conf-dir=/etc/dnsmasq.d"
conffile="/etc/dnsmasq.conf"
if ! grep -q "$confdir" "$conffile"; then
echo "$confdir" >> "$conffile"
fi
# Backup existing /etc/dnsmasq.conf if present and ensure that
# /etc/dnsmasq.conf contains only "conf-dir=/etc/dnsmasq.d"
local conffile="/etc/dnsmasq.conf"
if [[ -f "${conffile}" ]]; then
mv "${conffile}" "${conffile}.old"
fi
# Create /etc/dnsmasq.conf
echo "conf-dir=/etc/dnsmasq.d" > "${conffile}"
return 0
# Otherwise,

Loading…
Cancel
Save