diff options
author | gnhb <gnoahb@gmail.com> | 2010-03-28 22:00:33 +0700 |
---|---|---|
committer | gnhb <gnoahb@gmail.com> | 2010-03-28 22:00:33 +0700 |
commit | 158b5cc3fb62a52c7cd3ffc1c0d96db368a9c403 (patch) | |
tree | e7af1b589d7a452ddc69223cbf90a1f2982a187a | |
parent | 29533e50b8d6f8c1dc56f8fd947162df08ed2ec6 (diff) | |
download | pfsense-158b5cc3fb62a52c7cd3ffc1c0d96db368a9c403.zip pfsense-158b5cc3fb62a52c7cd3ffc1c0d96db368a9c403.tar.gz |
Fix mistakes (now using "call" instead of "goto") and add check to SIM PIN setting routine
so we don't have to set the pin every time if it's already set.
-rw-r--r-- | usr/local/sbin/mpd.script | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/usr/local/sbin/mpd.script b/usr/local/sbin/mpd.script index deb03a9..aa2501e 100644 --- a/usr/local/sbin/mpd.script +++ b/usr/local/sbin/mpd.script @@ -83,8 +83,8 @@ DialPeer1: DialPeer2: log "Detected $ModemDescription." call $ModemSetupFunc - if $SimPin != "" goto DialPeerSetPin - if $APN != "" goto DialPeerSetAPN + if $SimPin != "" call DialPeerSetPin + if $APN != "" call DialPeerSetAPN log "Dialing server at $Telephone..." call ModemDial if $dialResult == "OK" goto DialPeerOK @@ -101,9 +101,15 @@ DialPeer3: success DialPeerSetPin: + set $modemCmd "+CPIN=?" + log $modemCmd + call ModemQuery + log $modemQuery + if $modemQuery match ".*READY.*" PinReady set $modemCmd "+CPIN=\"$SimPin\"" call ModemCmd2 - wait $ConnectTimeout + wait $PinWait +PinReady: return DialPeerSetAPN: @@ -1514,7 +1520,7 @@ GetOK: wait 3 log "The modem is not responding." failure -GotOK +GotOK: return ## |