[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-ha-dev
Subject:    [Fwd: Re: [Linux-ha-dev] Re: Linux-HA-Dev Subscribe Notification]
From:       Eric Dillmann <lists () AAcom ! fr>
Date:       2002-03-15 15:58:42
[Download RAW message or body]

here is the script.

Eric
*** Ce message a été vérifié par un anti-virus ***

["IF" (text/plain)]

#!/bin/sh
#
# $Id$
#
# This script manages IP interfaces takeover
#
# (largely inspired from IPADDR), but RH-specific :-(
#
# usage: $0 if-name {start|stop|status}
#
# The "start" arg start the interface
#
# Surprisingly, the "stop" stop it
#
# Author: Eric Dillmann <edillmann@aacom.fr>
#
# Note: This command requires an argument, unlike normal init scripts.
#
# which can be given in the haresources file as: IF::eth0
#
# License: GPL
#

LC_ALL=en; export LC_ALL # Make ifconfig work in France for David Jules :-)

. /etc/ha.d/shellfuncs

#
# shutdown interface
#	
ip_stop() {
  /etc/sysconfig/network-scripts/ifdown $1
  /sbin/ifconfig $1 inet 0.0.0.0 down
  ha_log "IF $1 released"
}


#
# startup interface
#	
ip_start() {
  /etc/sysconfig/network-scripts/ifup $1
  ha_log "IF $1 started"
}

ip_status() {

  . /etc/sysconfig/network-scripts/ifcfg-$1

  if
    /sbin/ifconfig $1 | fgrep "inet adr:$IPADDR " >/dev/null 2>&1
  then
    echo "running"
  else
    echo "stopped"
  fi
}

#
#	start or stop interface
#
case $2 in
  start)	ip_start $1;;
  stop)		ip_stop $1;;
  status)	ip_status $1;;
esac



_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.community.tummy.com
http://lists.community.tummy.com/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic