home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
itrafic.zip
/
OFF.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-11-09
|
1KB
|
80 lines
/**/
i = 0
l = ''
retVal = 1
echo = ''
connected = 0
EOT = '04'x
ACK = '06'x
BEL = '07'x
signal on halt
signal on error
signal on syntax
call RxFuncAdd "loadrtn","Nvt","load_routine"
call loadrtn
call RxFuncDrop "loadrtn"
share = 'OS2ENVIRONMENT'
hostname = value('stofaloginhost',,share)
if hostname = ''
then do
say 'STOFALOGINHOST setting not found'
exit(2)
end
port = value('stofaloginport',,share)
if port = ''
then do
say 'STOFALOGINPORT setting not found'
exit(2)
end
userId = value('stofaloginuserid',,share)
if userId = ''
then do
say 'STOFALOGINUSERID setting not found'
exit(2)
end
password = value('stofaloginpassword',,share)
if password = ''
then do
say 'STOFALOGINPASSWORD setting not found'
exit(2)
end
socket = Telnet(hostname,port)
if socket = ''
then
say 'telnet connection failed'
else
do
c = Tput(socket,userId)
c = Tput(socket,password)
c = Tput(socket,2)
say 'Logging out OK!'
retVal = 0
do forever
l = Tget(socket)
select
when l = EOT then leave
when l = '' then leave
otherwise do; end;
end
end
end
call halt
return
halt:
call Tquit socket
call RxFuncAdd "droprtn","Nvt","drop_routine"
call droprtn
call RxFuncDrop "droprtn"
exit (retVal)