一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

real server 的一个启动脚本例子(推荐)

时间:2022-06-30 17:40:20 编辑:袖梨 来源:一聚教程网

#!/bin/bash
#chkconfig: 2345 50 50
#description: real server init script
 
VIP=192.168.80.80
case $1 in
"start")
  echo "starting real server ..."
  ifconfig lo:0 $VIP broadcast $VIP netmask 255.255.255.255 up
  echo "1">/proc/sys/net/ipv4/conf/lo/arp_ignore
  echo "2">/proc/sys/net/ipv4/conf/lo/arp_announce
  echo "1">/proc/sys/net/ipv4/conf/all/arp_ignore
  echo "2">/proc/sys/net/ipv4/conf/all/arp_announce
;;
"stop")
  echo "stoping real server ..."
  ifconfig lo:0 $VIP down
  echo "0">/proc/sys/net/ipv4/conf/lo/arp_ignore
  echo "0">/proc/sys/net/ipv4/conf/lo/arp_announce
  echo "0">/proc/sys/net/ipv4/conf/all/arp_ignore
  echo "0">/proc/sys/net/ipv4/conf/all/arp_announce
 
;;
"*")
  echo "not suport option $1"
   
;;
esac

热门栏目