summaryrefslogtreecommitdiffstats
path: root/usr/local/sbin
diff options
context:
space:
mode:
authorsmos <seth.mos@dds.nl>2012-05-20 13:21:46 +0200
committersmos <seth.mos@dds.nl>2012-05-20 13:21:46 +0200
commit1cba5c587d585baa38a76cb789930e63c955e51c (patch)
tree336c90a320b8d88b24d05ae7ee4ea19b05b299bd /usr/local/sbin
parent3930a9c0ea49014e08e266c33defd8b077829c6e (diff)
downloadpfsense-1cba5c587d585baa38a76cb789930e63c955e51c.zip
pfsense-1cba5c587d585baa38a76cb789930e63c955e51c.tar.gz
Make sure we don't accidentaly clobber the v4 dns servers with empty fields from v6
Diffstat (limited to 'usr/local/sbin')
-rwxr-xr-xusr/local/sbin/ppp-linkup42
1 files changed, 29 insertions, 13 deletions
diff --git a/usr/local/sbin/ppp-linkup b/usr/local/sbin/ppp-linkup
index 92afcab..b4e5984 100755
--- a/usr/local/sbin/ppp-linkup
+++ b/usr/local/sbin/ppp-linkup
@@ -5,6 +5,22 @@ if [ "$2" == "inet" ]; then
/bin/echo $4 > /tmp/$1_router
/bin/echo $3 > /tmp/$1_ip
/usr/bin/touch /tmp/$1up
+
+ ALLOWOVERRIDE=`/usr/bin/grep -c dnsallowoverride /conf/config.xml`
+ if [ $ALLOWOVERRIDE -gt 0 ]; then
+ # write nameservers to file
+ if [ $6 = "dns1" ]; then
+ echo $7 > /var/etc/nameserver_$1
+ /sbin/route change $7 $4
+ fi
+
+ if [ $8 = "dns2" ]; then
+ echo $9 >> /var/etc/nameserver_$1
+ /sbin/route change $9 $4
+ fi
+ /usr/local/sbin/pfSctl -c 'service reload dns'
+ /bin/sleep 1
+ fi
fi
if [ "$2" == "inet6" ]; then
@@ -12,22 +28,22 @@ if [ "$2" == "inet6" ]; then
/bin/echo $4 |cut -d% -f1 > /tmp/$1_routerv6
/bin/echo $3 |cut -d% -f1 > /tmp/$1_ipv6
/usr/bin/touch /tmp/$1upv6
-fi
-ALLOWOVERRIDE=`/usr/bin/grep -c dnsallowoverride /conf/config.xml`
-if [ $ALLOWOVERRIDE -gt 0 ]; then
- # write nameservers to file
- if [ $6 = "dns1" ]; then
- echo $7 > /var/etc/nameserver_$1
- /sbin/route change $7 $4
- fi
+ ALLOWOVERRIDE=`/usr/bin/grep -c dnsallowoverride /conf/config.xml`
+ if [ $ALLOWOVERRIDE -gt 0 ]; then
+ # write nameservers to file
+ if [ $6 = "dns1" ]; then
+ echo $7 > /var/etc/nameserver_v6$1
+ /sbin/route change -inet6 $7 $4
+ fi
- if [ $8 = "dns2" ]; then
- echo $9 >> /var/etc/nameserver_$1
- /sbin/route change $9 $4
+ if [ $8 = "dns2" ]; then
+ echo $9 >> /var/etc/nameserver_v6$1
+ /sbin/route change -inet6 $9 $4
+ fi
+ /usr/local/sbin/pfSctl -c 'service reload dns'
+ /bin/sleep 1
fi
- /usr/local/sbin/pfSctl -c 'service reload dns'
- /bin/sleep 1
fi
/usr/local/sbin/pfSctl -c "interface newip $1"
OpenPOWER on IntegriCloud