当前位置:主页 > 脚本语言 > Shell >

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

时间:2020-11-05 18:12:44 | 栏目:Shell | 点击:

real server 的vip 启动脚本

#!/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

您可能感兴趣的文章:

相关文章