home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Elysian Archive
/
AmigaElysianArchive.iso
/
comm
/
getffran.rex
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-02-27
|
4KB
|
180 lines
/* ARexx script to get a range of FF disks from ftp site */
/* Search for three asterisks to get to the section you need to modify
Then delete comment out these two lines below... */
SAY 'You must edit this script to set some values... Aborting...'
exit
/* Written by
Nickey MacDonald (i6t4@jupiter.sun.csd.unb.ca)
February 24, 1993
This script is written in AREXX for the AREXX port of TERM (2.4a).
This script was written to work with the ux1.cso.uiuc.edu anonymous
ftp archive of the Fred Fish Disks. Its directories are as follows:
/amiga
/fishdoc
/f3
Contents.3xx
/f4
Contents.4xx
/fy
Contents.yxx
/fish
/f5
/ff5xx
*.lzh
/f6
/f6xx
*.lzh
/fy
/fyxx
*.lzh
This script should be easily modified to handle another site with a
similar organization... especially if its just changing a few of the
defined variables at the start.
*/
/*** Some configurable values - You will have to change some of these ***/
ANONPWD='dumb-user@didnt-edit' /* Mail address - Anon ftp pass */
USERPROMPT='jupiter' /* Part of users csh prompt */
WHEREDIR='/tmp/i6t4' /* Where to put fish disks */
FTPSITE='ux1.cso.uiuc.edu' /* The site to use */
DOCDIR='/amiga/fishdoc' /* Where the contents files are */
DISKDIR='/amiga/fish' /* Where the fish disks are */
TIMEOUT='10 min' /* How long to WAITSTRING */
/* Allow results to be returned */
OPTIONS RESULTS
ADDRESS TERM
SAY 'What range of FF disks do you want to fetch?'
/* Get starting disk number */
RESULT=""
'GETSTRING "Starting FF disk number?"'
startval=RESULT
if DATATYPE(startval, 'N') = 0 then
do
SAY 'Disk number must be numeric.'
exit
end
/* Get ending disk number */
RESULT=""
'GETSTRING "Ending FF disk number?"'
endval=RESULT
if DATATYPE(endval, 'N') = 0 then
do
SAY 'Disk number must be numeric.'
exit
end
/* Lets make sure its worth starting... */
IF startval > endval then
do
SAY 'Start disk number must be less than end disk number!'
exit
end
SAY 'Getting FF disks' startval 'to' endval'...'
'SET TIMEOUT' TIMEOUT
/* Get into ftp */
SAY 'Starting ftp...'
'COMMAND' 'if ( ! -d' WHEREDIR ') mkdir' WHEREDIR'\r'
'WAITSTRING' USERPROMPT
'COMMAND' 'cd' WHEREDIR'\r'
'WAITSTRING' USERPROMPT
'COMMAND' 'ftp\r'
'WAITSTRING ftp>'
/* Connect to host */
SAY 'Connecting...'
'COMMAND' 'open' FTPSITE'\r'
'WAITSTRING name'
'COMMAND' 'anonymous\r'
'WAITSTRING pass'
'COMMAND' ANONPWD'\r'
'WAITSTRING ftp>'
/* Set mode */
SAY 'Setting up ftp...'
'COMMAND' 'bin\r'
'WAITSTRING ftp>'
'COMMAND' 'prompt\r'
'WAITSTRING ftp>'
'COMMAND' 'hash\r'
'WAITSTRING ftp>'
/* Get the contents files */
SAY 'Getting contents files...'
'COMMAND' 'cd' DOCDIR'\r'
'WAITSTRING ftp>'
do dnum=startval to endval
SAY ' Getting Contents.' || dnum || '...'
ddir='f' || TRUNC(dnum/100)
'COMMAND' 'cd' ddir '\r'
'WAITSTRING ftp>'
'COMMAND' 'get Contents.' || dnum '\r'
'WAITSTRING ftp>'
'COMMAND' 'cd ..\r'
'WAITSTRING ftp>'
end
/* Get the directories */
SAY 'Getting FF disks by dir...'
'COMMAND' 'cd' DISKDIR'\r'
'WAITSTRING ftp>'
do dnum=startval to endval
ddir='f' || TRUNC(dnum/100)
dname='ff' || dnum
SAY ' Getting' dname'...'
'COMMAND' 'cd' ddir '\r'
'WAITSTRING ftp>'
'COMMAND' '!mkdir 'dname'\r'
'WAITSTRING ftp>'
'COMMAND' 'lcd 'dname'\r'
'WAITSTRING ftp>'
'COMMAND' 'cd 'dname'\r'
'WAITSTRING ftp>'
'COMMAND' 'mget *\r'
'WAITSTRING ftp>'
'COMMAND' 'cd ../..\r'
'WAITSTRING ftp>'
'COMMAND' 'lcd ..\r'
'WAITSTRING ftp>'
end
/* All done finish up */
SAY 'All done... quitting ftp.'
'COMMAND ' 'close\r'
'WAITSTRING ftp>'
'COMMAND' 'quit\r'
'WAITSTRING' USERPROMPT
/* Create an LHA archive
SAY 'Archiving the directories...'
'COMMAND' 'lha c fishes' || startval || '-' || endval || '.lzh'
do dnum=startval to endval
'COMMAND' ' ff' || dnum
end
'COMMAND' '\r'
'WAITSTRING' USERPROMPT
*/
SAY 'Macro exiting.'
exit