diff options
author | smos <seth.mos@dds.nl> | 2012-05-28 14:53:38 +0200 |
---|---|---|
committer | smos <seth.mos@dds.nl> | 2012-05-28 14:55:55 +0200 |
commit | 703173f2530e6019c85b07e47c517ad69b10a6f7 (patch) | |
tree | a2c6dec7f1611c27f5da429ab2ba4d7aa78b9a1b /usr/local/sbin | |
parent | 8fe0f2d3a38fef62a5595e22567e72c17b099f5e (diff) | |
download | pfsense-703173f2530e6019c85b07e47c517ad69b10a6f7.zip pfsense-703173f2530e6019c85b07e47c517ad69b10a6f7.tar.gz |
Update the link script to parse the arguments 6 and 7 differently.
Previously mpd supplied the dns1 string as $6 and the IP as $7. It is now a single argument $6.
Apparently this changed somewhere so parse the IP out of there into the correct nameserver file.
Also fix the IPv6 string simultaneously
Redmine ticket #2458 Might need MFC to RELENG_2_0
Diffstat (limited to 'usr/local/sbin')
-rwxr-xr-x | usr/local/sbin/ppp-linkup | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/usr/local/sbin/ppp-linkup b/usr/local/sbin/ppp-linkup index b4e5984..d870821 100755 --- a/usr/local/sbin/ppp-linkup +++ b/usr/local/sbin/ppp-linkup @@ -9,14 +9,15 @@ if [ "$2" == "inet" ]; then 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 + if [ `echo $6|grep -c dns1` -gt 0 ]; then + DNS1=`echo $6 |cut -f2` + echo "$DNS1"> /var/etc/nameserver_$1 + /sbin/route change "$DNS1" $4 fi - - if [ $8 = "dns2" ]; then - echo $9 >> /var/etc/nameserver_$1 - /sbin/route change $9 $4 + if [ `echo $7|grep -c dns2` -gt 0 ]; then + DNS2=`echo $7 |cut -f2` + echo "$DNS2" >> /var/etc/nameserver_$1 + /sbin/route change "$DNS2" $4 fi /usr/local/sbin/pfSctl -c 'service reload dns' /bin/sleep 1 @@ -32,14 +33,15 @@ if [ "$2" == "inet6" ]; then 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 + if [ `echo $6|grep -c dns1` -gt 0 ]; then + DNS1=`echo $6 |cut -f2` + echo "$DNS1"> /var/etc/nameserver_v6$1 + /sbin/route change -inet6 "$DNS1" $4 fi - - if [ $8 = "dns2" ]; then - echo $9 >> /var/etc/nameserver_v6$1 - /sbin/route change -inet6 $9 $4 + if [ `echo $7|grep -c dns2` -gt 0 ]; then + DNS2=`echo $7 |cut -f2` + echo "$DNS2" >> /var/etc/nameserver_v6$1 + /sbin/route change -inet6 "$DNS2" $4 fi /usr/local/sbin/pfSctl -c 'service reload dns' /bin/sleep 1 |