随笔-314  评论-209  文章-0  trackbacks-0
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
      fi
fi
posted on 2016-03-24 12:08 xzc 阅读(1168) 评论(0)  编辑  收藏 所属分类: linux/unix

只有注册用户登录后才能发表评论。


网站导航: