]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- added automatically vlan shutdown before shutdowing interface (eth)
authormarcus <marcus@pld-linux.org>
Fri, 13 Jul 2001 17:47:44 +0000 (17:47 +0000)
committermarcus <marcus@pld-linux.org>
Fri, 13 Jul 2001 17:47:44 +0000 (17:47 +0000)
svn-id: @930

rc.d/init.d/functions.network
sysconfig/network-scripts/ifdown

index 59cd49f9e47a30b1b0fab8f1edf6c41fbc22615b..5204667bb5596b7702ad98da3a0509a0f5265352 100755 (executable)
@@ -1,5 +1,5 @@
 #
-# $Id: functions.network,v 1.60 2001/07/05 15:56:33 baggins Exp $
+# $Id: functions.network,v 1.61 2001/07/13 17:47:43 marcus Exp $
 # 
 # This is not a shell script; it provides functions to network scripts
 # that source it.
@@ -211,7 +211,7 @@ fi
 
 vlan_setup()
 {
-if [ -x /sbin/vconfig -a -e /proc/net/vlan/config ]; then
+if [ -x /sbin/vconfig -a -e /proc/net/vlan/config ] && `echo $DEVICE | grep -q ^eth`; then
        /sbin/vconfig set_name_type DEV_PLUS_VID_NO_PAD 2>&1 > /dev/null
        ETH_VLANS="yes"
 else
index 8365836da500652fdc6a4f97b754e641c0118295..897db0ee605349615ab713619931e1fb72d0f5df 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#      $Id: ifdown,v 1.30 2001/07/05 15:56:34 baggins Exp $
+#      $Id: ifdown,v 1.31 2001/07/13 17:47:44 marcus Exp $
 #
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 
@@ -88,13 +88,29 @@ if [ "$BOOTPROTO" = "dhcp" ]; then
     fi
 fi
 
-ip link set ${DEVICE} down
-ip addr flush dev ${DEVICE} 2>&1 | grep -v "Nothing to flush"
-
 vlan_setup
-if is_yes $ETH_VLANS && echo "$DEVICE" | grep -q '\.' ; then
-       /sbin/vconfig rem $DEVICE 2>&1 > /dev/null
-fi
+if is_yes $ETH_VLANS && `echo $DEVICE | grep -q ^eth` then
+    if echo "${DEVICE}" | grep -q '\.' ; then
+    # downujemy vlan
+    ip link set ${DEVICE} down
+    ip addr flush dev ${DEVICE} 2>&1 | grep -v "Nothing to flush"
+    /sbin/vconfig rem ${DEVICE} 2>&1 > /dev/null
+    else
+    # downujemy interfejs nadrzedny do vlanow
+    for VLANDEVICE in `ls /proc/net/vlan | grep ^${DEVICE}`
+       do
+       # najpierw wszystkie vlany po kolei
+       ip link set ${VLANDEVICE} down
+       ip addr flush dev ${VLANDEVICE} 2>&1 | grep -v "Nothing to flush"
+       /sbin/vconfig rem ${VLANDEVICE} 2>&1 > /dev/null
+    done 
+    # a potem dopiero interfejs nadrzedny
+    ip link set ${DEVICE} down
+    ip addr flush dev ${DEVICE} 2>&1 | grep -v "Nothing to flush"
+else
+    ip link set ${DEVICE} down
+    ip addr flush dev ${DEVICE} 2>&1 | grep -v "Nothing to flush"
+fi    
 
 if [ "$HANDLING" = "4" ]; then
     exit 0
This page took 0.837141 seconds and 4 git commands to generate.