- 论坛徽章:
- 0
|
我一般把密码保存到shell,然后用shc编译成可执行文件
通过参数读入上传/下载命令和文件列表
echo "open $ipadd">/tmp/ftptemp
echo "user $ln $enc128">>/tmp/ftptemp
echo "prompt off">>/tmp/ftptemp
echo "cd '${loc}'">>/tmp/ftptemp
for filelist in `cat $infile`
do
if [ ${fun} == "put" ] || [ ${fun} == "mput" ]
then
if [ ! -f ${filelist} ]
then
echo "File Dose Not Exsits: ${filelist}"
rm /tmp/ftptemp
quit 1
fi
fi
echo "$fun $filelist" >>/tmp/ftptemp
done
echo "close">>/tmp/ftptemp
echo "bye">>/tmp/ftptemp
cat /tmp/ftptemp|ftp -n
rm /tmp/ftptemp |
|