home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cardinal Internet Access Solutions
/
Cardinal_Internet_Access_Solutions(1996-08-19).iso
/
files
/
internet
/
slipnet
/
slipnet.z
/
LOGIN.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-03-23
|
6KB
|
252 lines
# Slip.Net LOGIN.CMD file for use with The Slip.Net Internet Launcher
# version 1.1h - 03/06/95 copyright Slip.Net - All Rights Reserved 1995
# for use with associated packages which are Shareware - please register!
# Following is for US Robotics 28.8's - you init string may be different
#$minit = "at&h1&r2&k3"
# This init string should work for everyone
$minit = "at&c1&d2"
# This is your Dialling Prefix (ie. "9" if you are in an office)
$prefix = ""
# following are modem numbers to be dialed for access to your account:
$dial1 = "12177922777"
$dial2 = "12177922777"
# The installer program for the Slip.Net Internet Launcher added these two lines:
$username = ""
$password = ""
# Do not change the pppprefix
$pppprefix = "S"
# ---------------------------------- LOGIN PROCESS ---------------------------
# You shouldn't have to modify anything below this line
# This script is very complicated. Slip.Net Technical support will not assist
# you if you modify this script. If you have enhancements, please mail them to
# launcher@slip.net for integration with our standard package
%time = 0
%time2 = 0
%time3 = 0
%maxtry = 0
%busy = 0
%cnct = 0
%login = 0 # not logged in
%estab = 0 # session not established
#
# initialize modem
#
output atz\n
input 10 OK\n
#
# set modem to indicate DCD
#
output at&c1&d2\n
input 10 OK\n
output ats10=11\n
input 10 OK\n
# now the init string defined at top of this pgm:
output $minit\n
input 10 OK\n
# overly complicated if/until loop since this scripting language doesn't support While
%tries = 0
%cnct = 0
%testab = 0
%tlogin = 0
%tcnct = 0
if %testab = 0
repeat
# repeat until estab
if %tlogin = 0
repeat
# repeat until login
if %tcnct = 0
repeat
# repeat until cnct
%tries = %tries + 1
$result = "Initialize"
display "Try #:" %tries \n
# Retries Expired check
# Make this number as large as you want
# hangup just in case we didn't already
#set DTR off
#sleep 1
#set DTR on
if %tries = 4
display "VHT ( Very High Traffic)." \7\n
display "Trying some other time." \n
display "Aborting." \n
set DTR off
sleep 1
set DTR on
abort
end
# following command removed to support some laptops - add it in only if needed
# wait 1
# We're about to dial now:
output ATDT
output $prefix
# wait a sec after we dial the prefix
if len($prefix) <> 0
output ","
end
if %busy = 0
output $dial1
else
output $dial2
end
output \13
# check for a result code within 10 seconds
%time = [read 20 $result]
%time = [read 20 $result]
# check if timed out
# this could be modem failure , or service
# took more than a minute to respond etc.
if %time=0 | $result = "RINGING"
display "Still waiting for a connect"\n
# wait another 10 seconds just to be sure its not going to answer
%time2 = [read 10 $result]
%time2 = [read 10 $result]
if %time2 = 0 | $result = "RINGING"
display "Still waiting for a connect"\n
%time3 = [read 10 $result]
%time3 = [read 10 $result]
if %time3 = 0 | $result = "RINGING"
display \n
display "ERROR Timed-out. Hanging up line to try again." \n
set DTR off
sleep 1
set DTR on
%cnct = 0
%busy = 1
#abort
end
end
else
%time2 = 0
# seems like we're online so drop thru:
end
# Check if Modem Returns BUSY
# does not work with $result = "CONNECT" ??
# but since usually the only two conditions
# are busy and not busy , this will work
# NO CARRIER for example will pass through but
# will be traped in the wait 30 dcd command below
if $result = "BUSY"
# display "This number is Busy." \n
%cnct = 0
%busy = 1
display "Redialling now" \n
else
if $result <> "NO CARRIER"
# Since connects look different depending on the modem:
display " Handshaking now."\n
%cnct = 1
end
# connect assumed successful
end
until %cnct = 1
end # if %tcnct = 0
%tcnct = 1
# now we are connected.
#
# wait till it's safe to send because some modem's hang up
# if you transmit during the connection phase
#
wait 10 dcd
#
# wait for the username prompt
#
%login = [input 15 login]
if %login = 0
# wait another 10 seconds just to be sure
%login = [read 10 $result]
if %login = 0
display \n
display "ERROR: login not received from Host Timed-out. Hangup line." \n
set DTR off
sleep 1
set DTR on
# force it to hangup and dial again:
%tcnct = 0
end
else
%login = 1
end
until %login = 1
end # if %login = 1
%tlogin = 1
#
# Edit the username at the top of this file to be your PPP login id assigned
# to you by slip.net
# (Be sure to put a 'S' first!)
# ***ENTER USERNAME AT THE TOP OF THIS FILE - NOT HERE
output $pppprefix
output $username\n
#
# and the password
#
input 30 Password:
#
# edit your_password to be your slip login password.
# ***ENTER PASSWORD AT THE TOP OF THIS FILE - NOT HERE
output $password\n
#
# we shoul now be logged in
#
# wait for the address string
#
input 30 to
#
# parse address
#
%estab = [address 10]
#
# we are now connected, logged in and in slip mode.
#
if %estab = 0
# wait another 20 seconds just to be sure
%estab = [address 10]
if %estab = 0
display \n
display "ERROR: PPP address not provided - be sure to log into a PPP account. Hanging up line." \n
display "you may have the wrong userid or password - please call technical support "\n
display "if you need more help at 1-415-281-3177"\n
set DTR off
sleep 1
set DTR on
# force it to hangup and dial again:
%tcnct = 0
%tlogin = 0
end
else
%estab = 1
end
until %estab = 1
end # if test to see if estab = 1
%testab = 1
# We'll never get here unless we actually established a PPP session:
display \n
display Connected. Your IP address is \i.\n
online