Re: Winsock script?

Mike Moskal (mmoskal@cyberlink.bc.ca)
Sun, 8 Oct 1995 10:29:42 -0600

Here are the files I use for trumpet, they work quite well.

-mike

--------------CUT---------------------------------
### login.cmd
### Modified by Cyberlink Systems Corp
### June 95

if ![load $number]
if [query $number "Enter your dial up 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 $init]
if [query $number "Enter your modem initialization string"]
save $init
end
end

### Define some string and numeric variables needed
$login_prompt = "login:"
$pswd_prompt = "Password:"
$shell_prompt = ">"
$connect_ready = "beginning...."
%dial_max = 200 ## maximum dials allowed

### initialize modem
output atz\n
if ! [input 10 OK]
display "Modem is not responding to init"\n
abort
end

### setup modem
output $init\n
if ! [input 10 OK]
display "Modem is not responding to setup"\n
abort
end

%dial = 0 ## initialize dial counter

### start dialing
repeat
%dial = %dial + 1 ## increment dial counter
$status = "" ## reset modem result string
%found = 0 ## reset keyword-found indicator
output atdt $number\r
sleep 4 ## allow 4 sec for modem to start dialing
%loop = 3 ## initialize status-gathering loops
repeat
read 45 $status ## 45 sec speed negotiation. If timeout
## the script would abort
%busy = pos("BUSY",$status) ## catch BUSY status
%connect = pos("CONNECT",$status) ## catch CONNECT status
%no_carrier = pos("NO CARRIER",$status) ## catch NO CARRIER status
%found = %busy + %connect + %no_carrier ## set found indicator
%loop = %loop - 1
until %found > 0 | %loop = 0
display \n"Dial" %dial " Status is" $status \n
if %busy > 0 | %no_carrier > 0
if %dial = %dial_max
display "Maximum dials reached."\n
display \n"*** Click [File][Exit] to exit trumpet ***"\n
display \7\7\7\7
abort
end
display "wait 10 seconds before redial"\n\n ## Wait betweem redial
sleep 10
set dtr off ###
sleep 1 # Toggle DTR to free modem connection
set dtr on ###
end
until %connect > 0

### wait till it's safe to send
wait 30 dcd

### now prod the terminal server
output \n

### wait for the login prompt
input 30 $login_prompt
output $username\n

### and the password
input 30 $pswd_prompt
output $password\n

### wait for the "Ready ..." string
input 30 ") to"
input 30 $connect_ready

### enable SLIP
display \n
online

### we are now connected, logged in and in slip mode.
display \n"*** Connected ***"\n
display \7\7\7\7

### end of login script
--------------CUT---------------------------------
### Setup.cmd
%ok = [load $number]
%ok = [load $password]
%ok = [load $username]
%ok = [load $init]

if [query $number "Enter your phone number"]
save $number
end
if [username "Enter your login username"]
save $username
end
if [password "Enter your login password"]
save $password
if [query $init "Enter your modem initialization string"]
save $init
end
--------------CUT---------------------------------
### bye.cmd
sleep 3
output +++
input 5 OK\n
output ath0\r
input 5 OK\n
--------------CUT---------------------------------

At 08:13 PM 10/7/95 -0500, you wrote:
> Greetings,
>
> Does anyone out there have a Trumpet Winsock script which works
>properly with a PM2E with Radius? I have modified someone else's script,
>but I can't get it to work reliably. Your assistance would be greatly
>appreciated... Please email to dennis@net66.com.
>
>Thanks.
>
>
>
>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Michael A. Moskal - Systems Administrator
CYBERLINK Systems Corp.
The East Kootenay's Premiere Internet Service Provider.
Phone : (604) 426-5175 Dialup: (604) 426-0565
Telnet: cyberlink.bc.ca
Email: mmoskal@cyberlink.bc.ca
WWW : http://www.cyberlink.bc.ca/~mmoskal/home.htm
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=