Rev 4 | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/bin/sh# This should be called whenever an interface goes down, not just when# it is brought down explicitly.cd /etc/sysconfig/network-scripts. ./network-functionsunset REALDEVICEif [ "$1" = --realdevice ] ; thenREALDEVICE=$2shift 2fiCONFIG=$1source_config[ -z "$REALDEVICE" ] && REALDEVICE=$DEVICE/etc/sysconfig/network-scripts/ifdown-routes ${REALDEVICE} ${DEVNAME}if [ "$PEERDNS" != "no" -o -n "$RESOLV_MODS" -a "$RESOLV_MODS" != "no" ] && \[ "${DEVICETYPE}" = "ppp" -o "${DEVICETYPE}" = "ippp" -o -n "${DNS1}" -o "${BOOTPROTO}" = "bootp" -o "${BOOTPROTO}" = "dhcp" ] ; thenif [ -f /etc/resolv.conf.save ]; thenchange_resolv_conf /etc/resolv.conf.saverm -f /etc/resolv.conf.savefiif [ "${DEVICETYPE}" = "ppp" -o "${DEVICETYPE}" = "ippp" ]; thenif [ -f /etc/ppp/peers/$DEVICE ] ; thenrm -f /etc/ppp/peers/$DEVICEfififi# Reset the default route if this interface had a special oneif ! check_default_route ; then# ISDN device needs special handling dial on demandif [ "${DEVICETYPE}" = "ippp" -o "${DEVICETYPE}" = "isdn" ] && [ "$DIALMODE" = "auto" ] ; thenif [ -z "$GATEWAY" ] ; then/sbin/ip route add default ${METRIC:+metric} \${WINDOW:+window $WINDOW} dev ${DEVICE}else/sbin/ip route add default ${METRIC:+metric} \${WINDOW:+window $WINDOW} via ${GATEWAY}fielseadd_default_route ${DEVICE}fifi# Notify programs that have requested notificationdo_netreportif [ -x /sbin/ifdown-local ]; then/sbin/ifdown-local ${DEVICE}fiexit 0