summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorsmos <seth.mos@dds.nl>2012-06-18 18:12:22 +0200
committersmos <seth.mos@dds.nl>2012-06-18 18:12:22 +0200
commit6be0280159d71f7de716c082c7c5dc96be6bc864 (patch)
treebe2d3f6b70b056d850642d333b0d24b22a5e6dfe /usr
parentce73b2c587e5057d27ffcb64f3a6c6703c69acb0 (diff)
downloadpfsense-6be0280159d71f7de716c082c7c5dc96be6bc864.zip
pfsense-6be0280159d71f7de716c082c7c5dc96be6bc864.tar.gz
Use awk instead of grep, this works on a v4 PPPoE connection for me. Need to verify that it works for 3G too.
Redmine ticket #2458
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/sbin/ppp-linkup16
1 files changed, 8 insertions, 8 deletions
diff --git a/usr/local/sbin/ppp-linkup b/usr/local/sbin/ppp-linkup
index d870821..dba4412 100755
--- a/usr/local/sbin/ppp-linkup
+++ b/usr/local/sbin/ppp-linkup
@@ -9,13 +9,13 @@ if [ "$2" == "inet" ]; then
ALLOWOVERRIDE=`/usr/bin/grep -c dnsallowoverride /conf/config.xml`
if [ $ALLOWOVERRIDE -gt 0 ]; then
# write nameservers to file
- if [ `echo $6|grep -c dns1` -gt 0 ]; then
- DNS1=`echo $6 |cut -f2`
+ if [ "`echo $6|grep -c dns1`" -gt 0 ]; then
+ DNS1=`echo $6 |awk '{print $2}'`
echo "$DNS1"> /var/etc/nameserver_$1
/sbin/route change "$DNS1" $4
fi
- if [ `echo $7|grep -c dns2` -gt 0 ]; then
- DNS2=`echo $7 |cut -f2`
+ if [ "`echo $7|grep -c dns2`" -gt 0 ]; then
+ DNS2=`echo $7 |awk '{print $2}'`
echo "$DNS2" >> /var/etc/nameserver_$1
/sbin/route change "$DNS2" $4
fi
@@ -33,13 +33,13 @@ if [ "$2" == "inet6" ]; then
ALLOWOVERRIDE=`/usr/bin/grep -c dnsallowoverride /conf/config.xml`
if [ $ALLOWOVERRIDE -gt 0 ]; then
# write nameservers to file
- if [ `echo $6|grep -c dns1` -gt 0 ]; then
- DNS1=`echo $6 |cut -f2`
+ if [ "`echo $6|grep -c dns1`" -gt 0 ]; then
+ DNS1=`echo $6 |awk '{print $2}'`
echo "$DNS1"> /var/etc/nameserver_v6$1
/sbin/route change -inet6 "$DNS1" $4
fi
- if [ `echo $7|grep -c dns2` -gt 0 ]; then
- DNS2=`echo $7 |cut -f2`
+ if [ "`echo $7|grep -c dns2`" -gt 0 ]; then
+ DNS2=`echo $7 |awk '{print $2}'`
echo "$DNS2" >> /var/etc/nameserver_v6$1
/sbin/route change -inet6 "$DNS2" $4
fi
OpenPOWER on IntegriCloud