dfs@doe.carleton.ca (David F. Skoll) (12/08/90)
The AutoFTP program posted recently is great! However, I find it quite annoying to have the IP address of the machine you want to contact hard-coded. The following patch modifies the autoftp30.sh program to allow you to specify the host on the command line after the control file name. So you can specify: sh autoftp30.sh getfile myhost@wherever.domain & to connect to the specified host. If you leave out the host argument, it defaults to the wired-in host. -- David Skoll ---------------- CUT HERE FOR PATCH -------------------- *** autoftp30.old Fri Dec 7 15:29:57 1990 --- autoftp30.sh Fri Dec 7 15:30:19 1990 *************** *** 47,56 **** # it with the host name of your machine on which this program is run. # eg., RemoteHost="26.2.0.74" # LocalHost="shire.cs.psu.edu" - RemoteHost="26.2.0.74" - LocalHost="guest" - # Set the path name for the directory where three compiled C programs # ftpget.c, nextfile.c and checkout.c are. This program assumes as # default that the three compiled programs are in $HOME/bin (a directory --- 47,56 ---- # it with the host name of your machine on which this program is run. # eg., RemoteHost="26.2.0.74" # LocalHost="shire.cs.psu.edu" + RemoteHost=$2 + test 1$RemoteHost = 1 && RemoteHost="26.2.0.74" + LocalHost="guest" # Set the path name for the directory where three compiled C programs # ftpget.c, nextfile.c and checkout.c are. This program assumes as # default that the three compiled programs are in $HOME/bin (a directory *************** *** 86,93 **** echo " 'nextfile' and place it in your '$FtpLibDir' directory." ; exit 2 ; } ! test $# != 1 && ! { echo "***Usage: sh autoftp30.sh in_file" ; exit 2; } exec 1>$$stdout 2>$$stderr --- 86,93 ---- echo " 'nextfile' and place it in your '$FtpLibDir' directory." ; exit 2 ; } ! test $# != 1 && test $# != 2 && ! { echo "***Usage: sh autoftp30.sh in_file [hostaddr]" ; exit 2; } exec 1>$$stdout 2>$$stderr