#!/bin/sh # # ifdown-sit # # # Taken from: # (P) & (C) 2000-2001 by Peter Bieringer # # RHL integration assistance by Pekka Savola # # Version 2001-07-15a # # Uses following information from /etc/sysconfig/network: # NETWORKING_IPV6=yes|no: controls IPv6 initialization (global setting) # # Uses following information from "/etc/sysconfig/network-scripts/ifcfg-$1": # For static tunnels # IPV6TUNNELIPV4="" # IPV6ADDR=/ [OPTIONAL: numbered tunnels] # # Get global network configuration . /etc/sysconfig/network # Source IPv4 helper functions cd /etc/sysconfig/network-scripts . network-functions CONFIG=$1 [ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG source_config # Test whether IPv6 should be configured, else stop [ "${NETWORKING_IPV6}" = "yes" ] || exit 0 if [ ! -f /etc/sysconfig/network-scripts/network-functions-ipv6 ]; then exit 1 fi # Source IPv6 helper functions . /etc/sysconfig/network-scripts/network-functions-ipv6 # IPv6 test, no module loaded, exit if system is not IPv6-ready test_ipv6 testonly || exit 0 # Delete IPv6-in-IPv4 tunnel(s) if [ "$DEVICE" = "sit0" ]; then ifdown_ipv6_autotunnel elif [ ! -z "$IPV6TUNNELIPV4" ]; then if [ "$IPV6_TUNNELMODE" = "NBMA" ]; then if [ ! -z "$IPV6ADDR" ]; then ifdown_ipv6_real sit0 $IPV6ADDR fi # Cleanup all IPv6 tunnel configuration on specified interface and shut down sit0, if no longer used ifdown_ipv6_tunnel_all $DEVICE $IPV6TUNNELIPV4 elif [ -z "$IPV6_TUNNELMODE" -o "$IPV6_TUNNELMODE" = "IP" ]; then # Delete all IPv6 routes and addresses ifdown_ipv6_real_all $DEVICE # Shut down tunnel device ifdown_ipv6_tunneldev $DEVICE else echo $"Tunnel creation mode '$IPV6_TUNNELMODE' not supported - skip!" fi fi