aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifdown-ipv6
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig/network-scripts/ifdown-ipv6')
-rwxr-xr-xsysconfig/network-scripts/ifdown-ipv657
1 files changed, 57 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/ifdown-ipv6 b/sysconfig/network-scripts/ifdown-ipv6
new file mode 100755
index 00000000..5d443cf1
--- /dev/null
+++ b/sysconfig/network-scripts/ifdown-ipv6
@@ -0,0 +1,57 @@
+#!/bin/bash
+#
+# ifdown-ipv6
+#
+# Taken from scripts from:
+#
+# (P) & (C) 2000 Peter Bieringer <pb@bieringer.de>
+# some hints taken from RedHat scripts
+
+. /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
+
+ # Delete tunnel
+ if ! [ -z "$IPV6TUNNELIPV4" -o -z "$IPV6TUNNELROUTE" ]; then
+ ifdown_ipv6_tunnel $DEVICE $IPV6TUNNELIPV4 $IPV6TUNNELROUTE
+ fi
+
+ # Shutdown additional (1) IPv6 address on specified interface
+ if ! [ -z "$IPV6ADDR_0" -o -z "$IPV6PREFIXLENGTH_0" ]; then
+ ifdown_ipv6_real $DEVICE $IPV6ADDR_0 $IPV6PREFIXLENGTH_0
+ fi
+
+ # Shutdown additional (2) IPv6 address on specified interface
+ if ! [ -z "$IPV6ADDR_1" -o -z "$IPV6PREFIXLENGTH_1" ]; then
+ ifdown_ipv6_real $DEVICE $IPV6ADDR_1 $IPV6PREFIXLENGTH_1
+ fi
+
+ # Shutdown IPv6 address on specified interface
+ if ! [ -z "$IPV6ADDR" -o -z "$IPV6PREFIXLENGTH" ]; then
+ ifdown_ipv6_real $DEVICE $IPV6ADDR $IPV6PREFIXLENGTH
+ fi
+fi