Skip to content
Snippets Groups Projects
Commit ae961d3b authored by Bob Mottram's avatar Bob Mottram
Browse files

Remove ipv6 entries if they're not available

parent 2cf05eca
No related branches found
No related tags found
No related merge requests found
......@@ -87,8 +87,8 @@ function pihole_update {
write_config_param "PIHOLE_IFACE" "$PIHOLE_IFACE"
fi
IPv4_address=$(get_ipv4_address)
IPv6_address=$(get_ipv6_address)
IPv4_address="$(get_ipv4_address)"
IPv6_address="$(get_ipv6_address)"
setupVars=$piholeDir/setupVars.conf
echo "piholeInterface=${PIHOLE_IFACE}" > ${setupVars}
......@@ -110,7 +110,11 @@ function pihole_update {
sed -i "s|@DNS2@|${PIHOLE_DNS2}|g" /etc/dnsmasq.d/01-pihole.conf
sed -i "s|interface=.*|interface=${PIHOLE_IFACE}|g" /etc/dnsmasq.d/01-pihole.conf
sed -i "s|@IPv4@|${IPv4_address}|g" /etc/dnsmasq.d/01-pihole.conf
sed -i "s|@IPv6@|${IPv6_address}|g" /etc/dnsmasq.d/01-pihole.conf
if [ ${#IPv6_address} -gt 0 ]; then
sed -i "s|@IPv6@|${IPv6_address}|g" /etc/dnsmasq.d/01-pihole.conf
else
sed -i '/@IPv6@/d' /etc/dnsmasq.d/01-pihole.conf
fi
sed -i "s|@HOSTNAME@|$HOSTNAME|g" /etc/dnsmasq.d/01-pihole.conf
systemctl restart dnsmasq
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment