if [ $OLDGW == 'x.x.x.x' ]; then exit 0
fi
cd /etc/config/
mkdir pptp-vpn
cd pptp-vpn
vim chnroutes.sh
#!/bin/sh
if [ -f "/tmp/vpn_status_check.lock" ]
then
exit 0
fi
VPN_CONN=`ifconfig | grep pptp-vpn`
if [ -z "$VPN_CONN" ]
then
touch /tmp/vpn_status_check.lock
echo WAN_VPN_RECONNECT at: >> /tmp/vpn_status_check_reconn.log
date >> /tmp/vpn_status_check_reconn.log
ifdown vpn
ifdown wan
sleep 10
ifup wan
sleep 30
ifdown vpn
sleep 10
ifup vpn
sleep 40
rm /tmp/vpn_status_check.lock
else
date > /tmp/vpn_status_check.log
fi
root@FC_R0:/tmp# ls vpn*
vpn_oldgw vpn_status_check.log
root@FC_R0:/tmp# cat vpn_status_check.log
Tue Jul 15 00:04:02 HKT 2014
root@FC_R0:/tmp#
FL-MBP:~ fatlyz$ traceroute www.google.com | head -n 3
traceroute: Warning: www.google.com has multiple addresses; using 74.125.239.115
traceroute to www.google.com (74.125.239.115), 64 hops max, 52 byte packets
1 fc_r0.lan (192.168.7.1) 2.161 ms 0.912 ms 0.895 ms
2 10.7.0.1 (10.7.0.1) 193.747 ms 187.789 ms 289.744 ms
3 23.92.24.2 (23.92.24.2) 259.323 ms 354.625 ms 408.535 ms
FL-MBP:~ fatlyz$ traceroute www.baidu.com | head -n 3
traceroute to www.a.shifen.com (180.76.3.151), 64 hops max, 52 byte packets
1 fc_r0.lan (192.168.7.1) 1.190 ms 0.984 ms 0.731 ms
2 58.111.43.1 (58.111.43.1) 20.616 ms 38.822 ms 18.484 ms
3 183.56.35.133 (183.56.35.133) 20.056 ms 52.353 ms 87.841 ms
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |