#!/bin/sh
#
#	$Id: ifdown-post,v 1.10 2000/03/27 16:07:52 misiek Exp $
#
# This should be called whenever an interface goes down, not just when
# it is brought down explicitly.

run_down() { :; }

CONFIG=$1
. /etc/sysconfig/network
. /etc/rc.d/init.d/functions
. /etc/sysconfig/network-scripts/.functions

source_config

# full device name as specified by user
FULLDEVNAME="$DEVICE"
# type of device for example "dummy" or "eth"
DEVICETYPE=`echo $FULLDEVNAME | sed "s/[0-9]*$//"`
# name of real device ie. eth0 when eth0,eth0:1,eth0:alias
DEVICE=`echo $FULLDEVNAME | sed 's/:.*//g'`

if echo "$FULLDEVNAME" | grep -q ':' ; then
        ISALIAS=yes
else
        ISALIAS=no
fi

# execute run_up() function (if available in device configuration file)
[ "$ISALIAS" = "no" ] && run_down

# Notify programs that have requested notification
do_netreport

exit 0
