diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-11-14 07:00:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-14 07:00:30 +0100 |
commit | 92b828154497c534ce82af16320ed34f0c15e51c (patch) | |
tree | 4fb0e69e87e37cca30451af6c06a83944486c2ad /src/etc/ppp/ip-up.d | |
parent | 61574eaf2d703e8084c8272e6976fd44abaea482 (diff) | |
parent | 00ec496877453cc37ceec0633821a47f128d9f4f (diff) | |
download | vyos-1x-92b828154497c534ce82af16320ed34f0c15e51c.tar.gz vyos-1x-92b828154497c534ce82af16320ed34f0c15e51c.zip |
Merge pull request #1656 from vfreex/fix-ns-config
T4815: Fix various name server config issues
Diffstat (limited to 'src/etc/ppp/ip-up.d')
-rw-r--r-- | src/etc/ppp/ip-up.d/98-vyos-pppoe-setup-nameservers | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/etc/ppp/ip-up.d/98-vyos-pppoe-setup-nameservers b/src/etc/ppp/ip-up.d/98-vyos-pppoe-setup-nameservers new file mode 100644 index 000000000..0fcedbedc --- /dev/null +++ b/src/etc/ppp/ip-up.d/98-vyos-pppoe-setup-nameservers @@ -0,0 +1,24 @@ +#!/bin/bash +### Autogenerated by interfaces-pppoe.py ### + +interface=$6 +if [ -z "$interface" ]; then + exit +fi + +if ! /usr/bin/systemctl -q is-active vyos-hostsd; then + exit # vyos-hostsd is not running +fi + +hostsd_client="/usr/bin/vyos-hostsd-client" + +$hostsd_client --delete-name-servers --tag "dhcp-$interface" + +if [ "$USEPEERDNS" ] && [ -n "$DNS1" ]; then +$hostsd_client --add-name-servers "$DNS1" --tag "dhcp-$interface" +fi +if [ "$USEPEERDNS" ] && [ -n "$DNS2" ]; then +$hostsd_client --add-name-servers "$DNS2" --tag "dhcp-$interface" +fi + +$hostsd_client --apply |