diff --git a/src/freedombone-app-pihole b/src/freedombone-app-pihole index a3e91509..084406d1 100755 --- a/src/freedombone-app-pihole +++ b/src/freedombone-app-pihole @@ -79,12 +79,11 @@ function pihole_update { return fi - if [[ $(config_param_exists WIFI_INTERFACE) == "0" ]]; then + if [ ! -f $HOME/${PROJECT_NAME}-wifi.cfg ]; then PIHOLE_IFACE=eth0 else read_config_param WIFI_INTERFACE PIHOLE_IFACE=$WIFI_INTERFACE - write_config_param "PIHOLE_IFACE" "$PIHOLE_IFACE" fi IPv4_address="$(get_ipv4_address)" @@ -116,6 +115,7 @@ function pihole_update { sed -i '/@IPv6@/d' /etc/dnsmasq.d/01-pihole.conf fi sed -i "s|@HOSTNAME@|$HOSTNAME|g" /etc/dnsmasq.d/01-pihole.conf + sed -i "s|addn-hosts=.*|addn-hosts=${PIHOLE_ADLIST}|g" /etc/dnsmasq.d/01-pihole.conf systemctl restart dnsmasq