7 月 222015
 

网络老是不稳定,写了个检测翻墙的脚本。

[root@localhost ~]# cat /root/shell/checkip.sh
ip=$(/usr/bin/curl  -s ip.cn | awk ‘{print $2}’ | awk -F ‘:’ ‘{print $2}’)

source /etc/profile

if [ $ip != “100.42.209.10” ]
then
killall -9  pppd
/usr/sbin/pppd  call vpn updetach
sleep 5
/sbin/route add -net 0.0.0.0 dev ppp0
fi

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny