文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
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

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载