[comp.sys.amiga] Automatically uploading & downloading

ugpete@sunybcs (Peter Theobald) (05/17/88)

I have set up a script that allows me to turn on my Amiga at night and
go to sleep while it calls up my Unix account and performs automatic
uploads and downloads for me. I thought you might like to see it. There
is really nothing tricky in it. It must be customized to whatever system
you are using.

Here's how to use it: You put any files you want to download in your UNIX
subdirectory 'download' and you put any files you want to upload in your
Amiga subdirectory 'upload'. Before you go to sleep, turn on the Amiga,
Kickstart it and put in the AUTOMODEM: disk. It will immediately ask you
'Do you want to Auto Transfer? (n for no)' And you answer with a return
and go to sleep. It will take care of the rest for you.

(My disk Automodem: has serial.device in devs, shell in :bin, and vt100 R2.8 .
All the necessary commands are in :c and :arp )

----- Automodem:s/startup-sequence ----------------------------------------
# I mount vd0: just so asdg-ram doesn't get trashed if I boot this disk
#		while I'm testing it.
c/mount vd0:
c/copy c/run vd0:
# Set the path, and go to the shell
arp/path reset sys:arp sys:c sys:bin
bin/shell bin/.login


----- Automodem:bin/.login ------------------------------------------------

echo -n Do you want to Auto Transfer? (n for no) 
input a
vd0:run arp/addbuffers df0: 30
date
# I use PopCli so that a few minutes after I boot the screen blanks out
#  while I sleep. Otherwise it would bother me & burn in the screen needlessly
vd0:run bin/popcli 300 newcli from sys:bin/poplogin
sleep 3
# shell.init just has my standard aliases. 
source bin/shell.init
bin/clickupfront
# If Auto Transfer has been chosen, run vt100
if $a <> "n"
# Run vt100 on the workbench screen (share) and execute autoload.vt100
vd0:run vt100 +i share autoload.vt100
endif

----- Automodem:autoload.vt100 -------------------------------------------

delay 2
baud 1200
parity space
xproto kermit
mode image
kmaxpack 1000
#
start:
delay 1
on ">" goto dial
send ^M
goto start
#
dial:
on "CONNECT 1200" goto login
# The phone number has been changed to protect the innocent
send "ATDT8269540^M"
wait
#
login:
delay 1
on "HOST ACCESS CODE" goto in
send ^M^M
goto login
#
in:
send ^M
send "joey^M^M"
#
username:
on "login:" goto entre
wait
#
entre:
send "ugpete^M"
on "Password" goto secret
delay 3
goto entre
#
secret:
send "wouldntyouliketoknow^M"
#
logged:
on "Pete" goto prompt
delay 5
goto logged
#
prompt:
on "ermit>" goto kerm
send "cd amiga/download^M"
#
enterkm:
wait "Pete"
cd df0:download
send "kermit -i^M"
delay 5
goto enterkm
#
kerm:
on "ermit>" goto sendem
send "set file type binary^M"
wait
#
sendem:
on "ermit>" goto donesend
send "send *^M"
KR
wait 
#
donesend:
on "Pete" goto nowrec
send "quit^M"
wait
#
nowrec:
on "Pete" goto kmenter
cd df0:upload
send "cd ../upload^M"
wait
#
kmenter:
send "kermit -i^M"
wait "ermit>"
send "set file type binary^M"
wait "ermit>"
send "set receive timeout 15^M"
wait "ermit>"
on "ermit>" goto recdone
send "server^M"
KS *,$
#
recdone:
send "quit^M"
wait "Pete"
send "lo^M"
send "lo^Mlo^Mlo^M"
wait "NO CARRIER"
delay 2
exit vt100

---------------------------------------------------------------------------

Pretty neat huh? Next I'll have it download my news and have a crisp
printout waiting for me by my morning coffee when I wake up!

After VT100 quits it might be nice to have a script 'shar *.sh' then
'uncompress *.Z', 'arc x *.arc', 'zoo x *.zoo', '*.pak', 'uudecode *.uu?'
etc.. etc... etc...