Blame network-scripts/ifdown-sit

rpm-build 133ac4
#!/bin/bash
rpm-build 133ac4
#
rpm-build 133ac4
# ifdown-sit
rpm-build 133ac4
#
rpm-build 133ac4
#
rpm-build 133ac4
# Taken from:
rpm-build 133ac4
# (P) & (C) 2000-2003 by Peter Bieringer <pb@bieringer.de>
rpm-build 133ac4
#
rpm-build 133ac4
#  You will find more information on the initscripts-ipv6 homepage at
rpm-build 133ac4
#   http://www.deepspace6.net/projects/initscripts-ipv6.html
rpm-build 133ac4
#
rpm-build 133ac4
# RHL integration assistance by Pekka Savola <pekkas@netcore.fi>
rpm-build 133ac4
#
rpm-build 133ac4
# Version 2002-11-01
rpm-build 133ac4
#
rpm-build 133ac4
# Uses following information from /etc/sysconfig/network-scripts/ifcfg-$1:
rpm-build 133ac4
#  DEVICE=<device>
rpm-build 133ac4
#
rpm-build 133ac4
rpm-build 133ac4
rpm-build 133ac4
. /etc/sysconfig/network
rpm-build 133ac4
rpm-build 133ac4
cd /etc/sysconfig/network-scripts
rpm-build 133ac4
. ./network-functions
rpm-build 133ac4
rpm-build 133ac4
CONFIG=$1
rpm-build 133ac4
[ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG
rpm-build 133ac4
source_config
rpm-build 133ac4
rpm-build 133ac4
# IPv6 don't need aliases anymore, config is skipped
rpm-build 133ac4
REALDEVICE=${DEVICE%%:*}
rpm-build 133ac4
[ "$DEVICE" != "$REALDEVICE" ] && exit 0
rpm-build 133ac4
rpm-build 133ac4
[ -f /etc/sysconfig/network-scripts/network-functions-ipv6 ] || exit 1
rpm-build 133ac4
. /etc/sysconfig/network-scripts/network-functions-ipv6
rpm-build 133ac4
rpm-build 133ac4
rpm-build 133ac4
# Generic tunnel device sit0 is not supported here
rpm-build 133ac4
if [ "$DEVICE" = "sit0" ]; then
rpm-build 133ac4
    net_log $"Device '$DEVICE' isn't supported here, use IPV6_AUTOTUNNEL setting and restart (IPv6) networking"
rpm-build 133ac4
    exit 1
rpm-build 133ac4
fi
rpm-build 133ac4
rpm-build 133ac4
# IPv6 test, no module loaded, exit if system is not IPv6-ready
rpm-build 133ac4
ipv6_test testonly || exit 0
rpm-build 133ac4
rpm-build 133ac4
# Test device status
rpm-build 133ac4
ipv6_test_device_status $DEVICE
rpm-build 133ac4
if [ $? != 0 -a $? != 11 ]; then
rpm-build 133ac4
    # device doesn't exist or other problem occurs
rpm-build 133ac4
    exit 0
rpm-build 133ac4
fi
rpm-build 133ac4
rpm-build 133ac4
# Cleanup additional static routes
rpm-build 133ac4
/etc/sysconfig/network-scripts/ifdown-routes ${REALDEVICE}
rpm-build 133ac4
rpm-build 133ac4
# Cleanup and shut down IPv6-in-IPv4 tunnel device
rpm-build 133ac4
ipv6_del_tunnel_device $DEVICE