diff options
Diffstat (limited to 'usr')
-rw-r--r-- | usr/local/sbin/mpd.script | 4 | ||||
-rwxr-xr-x | usr/local/sbin/ppp-linkup | 42 |
2 files changed, 31 insertions, 15 deletions
diff --git a/usr/local/sbin/mpd.script b/usr/local/sbin/mpd.script index f69ac4b..a7e62dc 100644 --- a/usr/local/sbin/mpd.script +++ b/usr/local/sbin/mpd.script @@ -101,11 +101,11 @@ DialPeer3: success DialPeerSetPin: - set $modemCmd "+CPIN=?" + set $modemCmd "+CPIN?" log $modemCmd call ModemQuery log $modemQuery - if $modemQuery match ".*READY.*" PinReady + if $modemQuery match ".*READY.*" return set $modemCmd "+CPIN=\"$SimPin\"" call ModemCmd2 wait $PinWait diff --git a/usr/local/sbin/ppp-linkup b/usr/local/sbin/ppp-linkup index 92afcab..b4e5984 100755 --- a/usr/local/sbin/ppp-linkup +++ b/usr/local/sbin/ppp-linkup @@ -5,6 +5,22 @@ if [ "$2" == "inet" ]; then /bin/echo $4 > /tmp/$1_router /bin/echo $3 > /tmp/$1_ip /usr/bin/touch /tmp/$1up + + 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 + fi + + if [ $8 = "dns2" ]; then + echo $9 >> /var/etc/nameserver_$1 + /sbin/route change $9 $4 + fi + /usr/local/sbin/pfSctl -c 'service reload dns' + /bin/sleep 1 + fi fi if [ "$2" == "inet6" ]; then @@ -12,22 +28,22 @@ if [ "$2" == "inet6" ]; then /bin/echo $4 |cut -d% -f1 > /tmp/$1_routerv6 /bin/echo $3 |cut -d% -f1 > /tmp/$1_ipv6 /usr/bin/touch /tmp/$1upv6 -fi -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 - fi + 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 + fi - if [ $8 = "dns2" ]; then - echo $9 >> /var/etc/nameserver_$1 - /sbin/route change $9 $4 + if [ $8 = "dns2" ]; then + echo $9 >> /var/etc/nameserver_v6$1 + /sbin/route change -inet6 $9 $4 + fi + /usr/local/sbin/pfSctl -c 'service reload dns' + /bin/sleep 1 fi - /usr/local/sbin/pfSctl -c 'service reload dns' - /bin/sleep 1 fi /usr/local/sbin/pfSctl -c "interface newip $1" |