home *** CD-ROM | disk | FTP | other *** search
- # Login.cmd for WestNet Communications, Inc.
- #
- #trace on
- #
- # set up some strings for dialling up
- #
- if ![load $number]
- if [query $number "Enter WestNet's local phone number"]
- save $number
- end
- end
- if ![load $username]
- if [username "Enter your login username"]
- save $username
- end
- end
- if ![load $password]
- if [password "Enter your login password"]
- save $password
- end
- end
- if ![load $modemsetup]
- if [modemsetup "Enter your modem init string]
- save $modemsetup
- end
- end
-
- $prompt = ">"
- $userprompt = "ogin:"
- $passprompt = "assword:"
- $slipcmd = "slip"
-
- $addrtarg = "Your address is"
- $pppcmd = "ppp"
-
- #
- #----------------------------------------------------------
- #
- # initialize modem
- #output "ATZ"\13
- #if ! [input 10 OK\n]
- # display "Modem is not responding"\n
- # abort
- # end
- #
- # setup our modem commands
- #
- sleep 1
- # pause a second for modem to settle after atz
- output $modemsetup\13
- input 10 OK\n
- #
- # send phone number
- #
- %n = 1
- repeat
- output \13
- sleep 2
- # send CR and wait 2 seconds for modem to hang up if dialing.
- output "atdt"$number\13
- %busy = [input 10 BUSY]
- sleep 5
- # sleep long enough for modem to detect busy and hang up.
- if %busy
- display " attempt "%n" - redialing"\n
- %ok = 0
- else
- display \n"Waiting for connection"\n
- %ok = [input 40 CONNECT]
- end
- %n = %n + 1
- until %ok
- input 10 \n
- #
- # wait till it's safe to send because some modems hang up
- # if you transmit during the connection phase
- #
- wait 30 dcd
- #
- # now prod the terminal server
- #
- output \13
- #
- # wait for the username prompt
- #
- input 30 $userprompt
- output ppp:$username\13
- #
- # and the password
- #
- input 30 $passprompt
- output $password\13
- #
- # we are now logged in
- #
- # wait for the address string
- #
- input 30 to
- #
- # parse address
- #
- address 40
- #
- # we are now connected, logged in and in slip mode.
- #
- display \n
- display Connected. Your IP address is \i.\n
- sleep 1
- end
- #
- # now we are finished.
- #
-