#!/bin/sh # # ifdown-ipv6 # # # Taken from: # (P) & (C) 2000-2001 by Peter Bieringer # # Version 2001-02-08 # . /etc/sysconfig/network cd /etc/sysconfig/network-scripts . network-functions CONFIG=$1 [ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG source_config # Test if IPv6 configuration is enabled if [ ! "$IPV6INIT" = "yes" ]; then # not enabled, stop here exit 0 fi # Test if IPv6 is up if [ "${NETWORKING_IPV6}" = "yes" ]; then . /etc/sysconfig/network-scripts/network-functions-ipv6 # Delete additional static IPv6 routes on specified interface if [ -f /etc/sysconfig/static-routes-ipv6 ]; then grep "^$DEVICE" /etc/sysconfig/static-routes-ipv6 | while read device args; do if [ "$device" = "$DEVICE" ]; then ifdown_ipv6_route $args $DEVICE fi done fi # Switch off forwarding per device (packets received on this # interface aren't forwarded forwarding_ipv6 no $DEVICE # Delete additional IPv6 addresses from list if [ ! -z "$IPV6ADDR_SECONDARIES" ]; then for ipv6addr in $IPV6ADDR_SECONDARIES; do ifdown_ipv6_real $DEVICE $ipv6addr done fi # Shutdown basic configured IPv6 address on specified interface if ! [ -z "$IPV6ADDR" ]; then ifdown_ipv6_real $DEVICE $IPV6ADDR fi # Cleanup all IPv6 configuration on specified interface (prevents from kernel crashing) ifdown_ipv6_real_all $DEVICE fi