#!/bin/bash
uname=tanghongfei
passwd=123456
pass2=`echo -n $passwd | md5sum | cut -c9-24`
curl -H "Content-Type:application/x-www-form-urlencoded" -d "username=$uname&password=$pass2&drop=0&type=1&n=100" http://xxx.xxx.xxx.xxx/cgi-bin/do_login 2>/dev/null | grep error
if [ "$?" -eq "0" ]; then
exit -1
fi
exit 0
监控是否掉线
#! /bin/sh
interval=10
while (true)
do
result=`ping -w $interval www.baidu.com | grep '0 received'`
if [ "$result" != "" ]; then
echo "network status: disconnected!!! relogin!!!"
./login.sh
else
echo "network status: connected!"
sleep 10
fi
done
网友评论