From 703173f2530e6019c85b07e47c517ad69b10a6f7 Mon Sep 17 00:00:00 2001 From: smos Date: Mon, 28 May 2012 14:53:38 +0200 Subject: 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 --- usr/local/sbin/ppp-linkup | 30 ++++++++++++++++-------------- 1 file 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 -- cgit v1.1