diff options
-rwxr-xr-x | usr/local/sbin/ppp-linkup | 16 |
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 |