Set nameservers to be that which have been chosen by the user in the whiptail

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner 2020-03-11 18:55:43 +00:00
parent 1481cc583f
commit 175d32c5f6
No known key found for this signature in database
GPG key ID: 872950F3ECF2B173

View file

@ -854,7 +854,8 @@ setDHCPCD() {
# we can append these lines to dhcpcd.conf to enable a static IP # we can append these lines to dhcpcd.conf to enable a static IP
echo "interface ${PIHOLE_INTERFACE} echo "interface ${PIHOLE_INTERFACE}
static ip_address=${IPV4_ADDRESS} static ip_address=${IPV4_ADDRESS}
static routers=${IPv4gw}" | tee -a /etc/dhcpcd.conf >/dev/null static routers=${IPv4gw}
static domain_name_servers=${PIHOLE_DNS_1},${PIHOLE_DNS_2}" | tee -a /etc/dhcpcd.conf >/dev/null
# Then use the ip command to immediately set the new address # Then use the ip command to immediately set the new address
ip addr replace dev "${PIHOLE_INTERFACE}" "${IPV4_ADDRESS}" ip addr replace dev "${PIHOLE_INTERFACE}" "${IPV4_ADDRESS}"
# Also give a warning that the user may need to reboot their system # Also give a warning that the user may need to reboot their system