Because I'd rather not hardcode a password into the script, the script tries to get that from an environment variable.
@echo off
rem script to quickly get a file from /home/userid/ff on hostname.domain.
rem userid is hardcoded, set property FTPPASS in environment before use.
if "%FTPPASS%"=="" goto nopass
if "%1"=="" goto nofilen
> quickget.ftp echo USER userid
>>quickget.ftp echo %FTPPASS%
>>quickget.ftp echo cd ff
>>quickget.ftp echo bin
>>quickget.ftp echo get %1
>>quickget.ftp echo bye
ftp -n -s:quickget.ftp hostname.domain
del quickget.ftp
goto einde
:nopass
echo No password specified in environment (set FTPPASS=********)
goto einde
:nofilen
echo No file name specified
goto einde
:einde
1 comment:
Post a Comment