生成解析域名并添加VPN路由脚本

原文:http://blog.csdn.net/force_eagle/article/details/7164485

对于只针对部分网站翻墙的童鞋比较有用:)! 记得将VPN设置为不替换默认网关!


#!/bin/sh names="www.google.com www.blogspot.com" gw=192.168.100.10  for name in $names; do     address=`nslookup ${name} |grep Address |awk '{print $2}'|grep -v '#53'|xargs echo`     echo "#Add $name route for $address"     for addr in $address; do         echo "route add $addr mask 255.255.255.255 $gw"     done done 


作者:force_eagle 发表于2011-12-30 11:33:36 原文链接

发表评论