home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 2 BBS
/
02-BBS.zip
/
fidtun.zip
/
FidTun.cmd
next >
Wrap
OS/2 REXX Batch file
|
1997-01-05
|
3KB
|
169 lines
/* ************************************* */
/* Fidonet Internet Tunnel */
/* */
/* Ver 0.1b */
/* */
/* */
/* by Alok Sinha */
/* India */
/* */
/* */
/* ************************************* */
rc=RxFuncAdd("FtpLoadFuncs","rxFtp","FtpLoadFuncs")
rc=FtpLoadFuncs()
/* ****** Must Configure these to meet your system ****** */
/* Number of files you want to keep on the remote host spool */
xnum=20
/* ******* Remote Stuff ******* */
/* Say "Enter the Host name : " */
xhostname="200.200.200.2"
/* Say "Enter User ID : " */
xuser="anonymous"
/* Say "Enter Password : " */
xpassword = "a@b.com"
/* Remote Node Address */
xremotenode="17"
/* My stuff */
/* Local Node Address */
xmynode="08"
/* inspool */
xindir="i:\fidonet\files\inbound"
/* ooutspool */
xoutdir="i:\fidonet\files\outbound"
/* "Remote Directory on the remote host " */
xremdir= "/e/upload/017"
/* my recv mail directory on the remote host */
xrecvdir="/e/upload/008"
/* ***** Configuration Ends --- ****** */
/* STOP NO MORE USER DEFINABLE VARIABLE BELOW THIS POINT */
/* Setup the basics */
rc=FtpSetUser(xhostname, xuser, xpassword)
rc=FtpSetBinary("Binary")
rc=FtpChDir(xremdir)
/* send first */
xsendname="025e00"d2x(xremotenode)
/* now make a name for the files originating from this host */
xfname="fid"right(d2x(xmynode),3,0)
/* checking if the file on the rmeote machine exists, if yes, rename
it to something old */
n=xnum
do while n>0
cur=n
prev=n-1
xcur=right(cur,3,'0')
xprev=right(prev,3,'0')
rc=FtpRename(xfname"."xprev, xfname"."xcur)
n=n-1
end
/* delete previous copies of compressed output */
say
"@echo off"
say
"@del "xfname".zip > null"
/* compress new files, and name it fidtun.zip */
say
"@zip " xfname xoutdir"\"xsendname".* > null"
/* now put the compressed file on the remote host */
rc=FtpPutUnique(xfname".zip", xfname".001")
/* delete previous copies of compressed output */
say
"@del "xfname".zip"
/* That's It !!! files have been sent */
/* ---------------------------- */
/* Now lets get the files..... */
rc=FtpChDir(xrecvdir)
/* xfname=xindir"\fid"right(xmynode,3,0) */
rc=FtpLs("fid*","files.")
n=files.0
do while n>0
rc=FtpGet(xindir"\"files.n,files.n)
if rc=-1 then say "Error "FTPERRNO
else rc=FtpDelete(files.n)
n=n-1
end
say
left(xindir,3)
say
"cd "right(xindir,length(xindir)-3)
"unzip -oj fid*"
"del fid0*.*"
/* enough, go back home !! */
rc=FtpLogoff()
rc=FtpDropFuncs()