@
charlestang 自动穿墙我路由也有啊
wget -O -
http://smarthosts.googlecode.com/svn/trunk/hosts | grep -v github > /etc/hosts.smart
while :
do
__dev=$(ip link | grep state | awk '{ sub(":", "", $2); print $2 }' | grep vpn)
__if [ $? -ne 0 ]; then
____sleep 5
____continue
__fi
__ip route list table vpn | grep -v static | grep -v src | grep vpn
__if [ $? -eq 0 ]; then
____sleep 20
____continue
__fi
__sh -x /etc/ppp/ip-up $dev
done
wget -O -
http://autoddvpn.googlecode.com/svn/trunk/grace.d/vpnup.sh \
| awk "/begin batch route/,/end batch route/" \
| awk '/route add/ { print $4 }' \
| tee /tmp/blocked_ips \
| awk -v dev=$1 '{ print "ip route add "$1" table vpn dev "dev }' \
| sh