home *** CD-ROM | disk | FTP | other *** search
- # FLEX login.cmd for use with Trumpet Winsock 2.0b
- # speed-dialler and "Flex" customization by John Shalamskas
- #
- #trace on
-
- #
- # Here are the variables for you to fiddle with.
- #
- %redials = 50
- # Generic Modem Setup (use if ATZ is enough for you.)
- $modemsetup = "S11=50"
- #
- # Other simple things to try if that didn't work:
- #$modemsetup = "&FS11=50M1X7"
- #$modemsetup = "&FS11=50"
- #$modemsetup = "&F"
- #$modemsetup = "Z"
- #
- # Microcom Deskporte FAST ES 28.8 (and generic Rockwell chipsets)
- #$modemsetup = "&f&c1&D2&s1w1s11=50"
- #
- # USR Sportster V.34 talking to another V.34 modem (PIXI, Lavanet):
- #$modemsetup = "&F1 S11=50"
- # USR Sportster V.34: use following to disable v.34, V.42
- #$modemsetup = "&F1 S11=50 S56=64 S27=32"
- # USR Sportster V.34: force 24000 bps, disable v.34, disable v.42 (FLEX)
- #$modemsetup = "&F1 S11=50 &N12 S56=64 S27=32"
- # USR Sportster V.34: disable v.FC, disable v.42 (FLEX)
- #$modemsetup = "&F1 S11=50 S56=128 S27=32"
- #
- # ZyXEL U-1496E
- #$modemsetup = "&FM1X7S11=50"
- #
- $prompt = ""
- $userprompt = "ogin:"
- $passprompt = "word:"
- $slipcmd = ""
- $pppcmd = ""
- $addrtarg = "to "
- #
- # END of variables - STOP FIDDLING here
- # unless you know what you are doing!
- #
-
- #
- # set up some strings for dialling up
- #
- if ![load $number]
- if [query $number "Enter your dial up phone number"]
- save $number
- end
- end
- if ![load $username]
- if [username "Enter your shell login username"]
- save $username
- end
- end
- if ![load $password]
- if [password "Enter your shell login password"]
- save $password
- end
- end
-
- #---------------------- Initialization ---------------------------
- #
- %counter = %redials
- #
- # Initialize Modem
- #
- set dtr on
- output atz\r
- display \n
- if ! [input 3 OK\n]
- display "Modem is not responding"\n
- abort
- end
- #
- # setup our modem commands
- #
- output "at"$modemsetup\13
- input 5 OK\n
- #
- #----------------- BEGIN AUTODIAL LOOP ------------------
- #
- #trace on
- repeat
- %counter = %counter - 1
- %tries = %redials - %counter
- display Attempt number %tries ( %redials possible )\n
- if ! %counter <> 0
- display \n
- display Aborting after %tries redials.\n
- abort
- end
- #
- # Dial Aloha.Com
- #
- # The following "sleep" command only needed for
- # USR Sportster and maybe a few others.
- #
- sleep 1
- output "atdt"$number\13
- %busy = [input 15 BUSY\n]
- until ! %busy
- #
- #---------------- END AUTODIAL LOOP ---------------------
- #
- # At this point we have no busy signal. Go for connect.
- #
- %connect = [input 30 CONNECT]
- if %connect=0
- set dtr off
- sleep 1
- set dtr on
- output +++
- sleep 1
- display \n
- output ath0\r
- display \n
- display Unknown error. Try Dialler/Login. \n
- abort
- end
- #
- # wait till it's safe to send because some modems hang up
- # if you transmit during the connection phase
- #
- wait 30 dcd
- #
- # wait for the username prompt
- #
- input 30 $userprompt
- if %ppp
- output "P"$username\13
- else
- output "S"$username\13
- end
- #
- # and the password
- #
- input 30 $passprompt
- output $password\13
- #
- # we are now logged in
- #
- display \nConnected after %tries tries.\n
- if %ppp
- #
- # jump into ppp mode
- #
- #output $pppcmd\13
- #
- #input 30 \n
- #
- display "PPP mode selected. Will try to negotiate IP address."\n
- #
- else
- #
- # jump into slip mode
- #
- #output $slipcmd\13
- #
- # wait for the address string
- #
- input 30 $addrtarg
- #
- # parse address
- #
- address 30
- #
- # we are now connected, logged in and in slip mode.
- #
- display \nDuring this session your IP address is \i.\n\n\n
- end
-