文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>for循环批量添加网关

for循环批量添加网关

时间:2010-11-15  来源:expert1

#!/bin/sh

#expert1

#name addgw.sh

 

out=$1

in=$2

###### add gateway to network#####

mv /etc/rc.local /etc/rc.local.bak

echo "#!/bin/sh -e ">>/etc/rc.local && chmod 755 /etc/rc.local

 

###### for loop start###

for i in 202.108.12.0/24 202.108.13.0/24 202.108.15.0/24 202.108.29.0/24 61.135.158.0/24 61.135.159.0/24 ;do echo "route add -net $i gw ${out} ">>/etc/rc.local;done

echo "" >>/etc/rc.local

echo "route add -host 218.30.x.x gw ${in} ">>/etc/rc.local

echo "route add -host 202.108.x.x gw ${in} " >>/etc/rc.local

echo "route add -host 61.135.x.x gw ${in} " >>/etc/rc.local

echo "" >>/etc/rc.local

相关阅读 更多 +
排行榜 更多 +
找茬脑洞的世界安卓版

找茬脑洞的世界安卓版

休闲益智 下载
滑板英雄跑酷2手游

滑板英雄跑酷2手游

休闲益智 下载
披萨对对看下载

披萨对对看下载

休闲益智 下载