home *** CD-ROM | disk | FTP | other *** search
- # Login.cmd for Scruz-Net
- #
- # *** WARNING: YOU MUST DELETE EVERYTHING ABOVE THIS LINE!! ***
- # *** Note: You may also need to delete lines from the end of ***
- # *** this file ***
- ##############################################################################
- #
- # login.cmd v95.9.28
- # Neil Magedman <neil@scruz.net>
- # Based loosely on the login.cmd that comes with the standard
- # twsk20b.zip package
- #
- #
-
-
- ###
- # Constants
- ###
-
- $userprompt = "ogin:"
- $passprompt = "ssword:"
- $your_address_is = "to "
-
-
- ###
- # Check for first timers...
- ###
- if ![load $setup_run]
- display \n\nYou must first run the setup script, Dialler|setup.cmd.\n
- display (Go to the "Dialler" menu and select "setup.cmd")\n
- abort
- end
-
-
-
- ###
- # set up some connection variables
- ###
-
- if (![load $phone_number]) | ($phone_number = "")
- query $phone_number Enter the number to dial
- end
-
- if (![load $username]) | ($username = "")
- username "Enter your login username"
- end
-
- if (![load $password]) | ($password = ""
- )
- password "Enter your login password"
- end
-
- if ![load $modeminit]
- $modeminit = "at"
- end
-
- if ![load %attempts]
- %attempts = 10
- end
-
-
-
- ###
- # Reset (and test) modem
- ###
-
- output "atz"\r
- if ! [input 10 OK\n]
- display "Modem is not responding"\n
- abort
- end
-
-
-
- ###
- # Send initialization string
- ###
-
- output $modeminit\r
- input 10 OK\n
-
-
-
- ###
- # redial until connected
- ###
-
- %n = 1
- repeat
-
- if %n > %attempts
- display \n\n
- display *** Scruznet maintains a no busy signal policy.\n
- display *** If you are receiving busy signals, please notify Scruznet.\n\n
- abort
- end
-
- # Dial
- display Cycle %n:\n
- if %n > 1
- sleep 3
- end
- outputecho 40 "atdt"$phone_number\r
- read 60 $modem_response
-
- %n = %n + 1
- until pos("CONNECT", $modem_response)
-
-
-
- ###
- # Log in
- ###
-
- wait 30 dcd # wait for connection to stabilize
- %logged_in = 0 # boolean - are we in?
- %failed_logins = 0 # counter - abort after three
- repeat
-
- input 30 $userprompt
- output $username\r
- input 30 $passprompt
- output
- $password
- outputecho \r
-
-
- if [expect 10 "Invalid Login"]
- %failed_logins = %failed_logins + 1
- if %failed_logins = 3
- display \n\n\n\7\7\7*** Wrong name and/or password. Aborting! ***\n\n\n
- set dtr off
- abort
- end
- repeat
- username "Enter your login username"
- until $username <> ""
- repeat
- password "Enter your login password"
- until $password <> ""
-
- else
- %logged_in = 1
- end
-
- until %logged_in
-
-
-
- ###
- # we are now logged in!! Yippy Skippy!
- # Establish slip/ppp mode
- ###
-
- if ! %ppp
- input 30 $your_address_is
- address 30
- end
-
- input 30 begin
- online
-
-
- display \n\n\7\7\7
- display ***************************************************************\n
- display Connection established! You may now run your winsock programs.\n
- display ***************************************************************\n\n
-
-
- ###
- # fin
- ###
-
-
- ###########################################################################
- # *** WARNING: YOU MUST DELETE EVERYTHING BELOW THIS LINE!! ***#