summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-12-21 14:39:27 -0500
committerjim-p <jimp@pfsense.org>2012-12-21 14:39:27 -0500
commit5feadf7fca75866582af73834c8d2ab14edca456 (patch)
treec9f36876221c3dc8f9266fda9ef9c93477459f55 /usr/local
parent2dd57bd95f67044bc7cfebdcda287fd88f16f066 (diff)
downloadpfsense-5feadf7fca75866582af73834c8d2ab14edca456.zip
pfsense-5feadf7fca75866582af73834c8d2ab14edca456.tar.gz
Fix obtaining DNS servers from PPP
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/sbin/ppp-linkup21
1 files changed, 11 insertions, 10 deletions
diff --git a/usr/local/sbin/ppp-linkup b/usr/local/sbin/ppp-linkup
index 12dda9b..bf7f70b 100755
--- a/usr/local/sbin/ppp-linkup
+++ b/usr/local/sbin/ppp-linkup
@@ -5,19 +5,20 @@
/bin/echo $3 > /tmp/$1_ip
/usr/bin/touch /tmp/$1up
-ALLOWOVERRIDE=`/usr/bin/grep dnsallowoverride /conf/config.xml | /usr/bin/wc -l`
+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 delete $7
- /sbin/route add $7 $4
+ if [ "`echo $6|grep -c dns1`" -gt 0 ]; then
+ DNS1=`echo $6 |awk '{print $2}'`
+ echo "$DNS1"> /var/etc/nameserver_$1
+ /sbin/route delete ${DNS1}
+ /sbin/route add ${DNS1} $4
fi
-
- if [ $8 = "dns2" ]; then
- echo $9 >> /var/etc/nameserver_$1
- /sbin/route delete $9
- /sbin/route add $9 $4
+ if [ "`echo $7|grep -c dns2`" -gt 0 ]; then
+ DNS2=`echo $7 |awk '{print $2}'`
+ echo "$DNS2" >> /var/etc/nameserver_$1
+ /sbin/route delete ${DNS2}
+ /sbin/route add ${DNS2} $4
fi
/usr/local/sbin/pfSctl -c 'service reload dns'
/bin/sleep 1
OpenPOWER on IntegriCloud