首页 > Web开发 > 详细

使用shell编写判断URL是否成功登陆的脚本

时间:2019-05-21 10:41:36      阅读:203      评论:0      收藏:0      [点我收藏+]
#!/bin/bash

dir="脚本的所在目录"
echo $dir
cd $dir
if [ $? == 0 ]
then pass
else
echo "wrong directory";exit 1
fi
[ -f $dir/ok.txt ] && echo > $dir/ok.txt
[ -f $dir/err.txt ] && echo > $dir/err.txt
while read url
do
wget --spider -q -o /dev/null --tries=1 -T 5 $url
if [ $? -eq 0 ]
then
echo $url >>$dir/ok.txt
action "$url is ok !" /bin/true
else
echo $url >>$dir/err.txt
action "$url is bad !" /bin/false
fi
done<$dir/url

使用shell编写判断URL是否成功登陆的脚本

原文:https://blog.51cto.com/12942223/2397395

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!