status=`ftp -v -n $ip<<END_SCRIPT
user $name $code
binary
cd $remote_dir
lcd $local_dir
prompt
mget *.txt
#mdelete *.txt
close
bye
END_SCRIPT`
echo $status|grep "226 Transfer complete"
if [ $? -eq 0 ]
then
echo "Connect Succeed!!!"
exit 0
else
echo $status|grep "530 Login incorrect"
if [ $? -eq 0 ]
then
echo "FTP Connect Error!!!"
exit 1
else
echo "No data transferred!!!"
exit 0
posted on 2016-03-24 12:08
xzc 阅读(1171)
评论(0) 编辑 收藏 所属分类:
linux/unix