interfaces: our dhclient-script doesn't clobber resolv.conf #3197

The FreeBSD one does, but we have different code that is "safe"
for multiple DHCP connections.
This commit is contained in:
Franco Fichtner 2019-02-08 22:23:18 +01:00
parent a1dbbb5ef1
commit b20f71b19e

View File

@ -246,12 +246,14 @@ add_new_routes() {
add_new_resolv_conf() {
$LOGGER "Creating resolv.conf"
if [ -f "/var/etc/nameserver_$interface" ]; then
# Remove old entries
for nameserver in `cat /var/etc/nameserver_$interface`; do
route delete $nameserver >/dev/null 2>&1
done
fi
if [ -n "$new_domain_name_servers" ]; then
rm -f /var/etc/nameserver_$interface
ALLOWOVERRIDE=$(grep -c dnsallowoverride /conf/config.xml)
@ -368,9 +370,9 @@ BOUND|RENEW|REBIND|REBOOT)
add_new_alias
changes="yes"
fi
if is_default_interface; then
#if is_default_interface; then
add_new_resolv_conf
fi
#fi
if [ "$changes" = "yes" ] ; then
/usr/local/etc/rc.newwanip $interface
fi