Remove ipv6 entries if they're not available
This commit is contained in:
parent
2cf05ecaf4
commit
ae961d3bc3
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue