]> git.pld-linux.org Git - projects/rc-scripts.git/blobdiff - rc.d/init.d/network
- merge my private tree
[projects/rc-scripts.git] / rc.d / init.d / network
index 6eaa4c83661cd901ec0ebfc833ab33998c3062d2..d81c9e3467282136c8b4f0fcc654ac8331409441 100644 (file)
@@ -8,7 +8,7 @@
 #
 # probe:       true
 
-# $Id: network,v 1.34.2.5 2000/11/06 16:26:04 baggins Exp $
+# $Id: network,v 1.34.2.6 2001/09/30 10:19:38 misiek Exp $
 
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 
@@ -17,7 +17,7 @@ NLS_DOMAIN="rc-scripts"
 
 # Source function library.
 . /etc/rc.d/init.d/functions
-. /etc/sysconfig/network-scripts/.functions
+. /etc/sysconfig/network-scripts/functions.network
 
 if [ ! -f /etc/sysconfig/network ]; then
        nls "%s is missing. Can't continue." "/etc/sysconfig/network"
@@ -45,7 +45,7 @@ fi
 network_init()
 {
 # Kernel network parameters
-run_cmd "Setting network parameters" sysctl -p /etc/sysctl.conf
+run_cmd "Setting kernel network parameters" sysctl -p /etc/sysctl.conf
 
 # Set UP loopback interface
 set_up_loopback
@@ -84,9 +84,11 @@ fi
 
 network_postinit()
 {
+# Set static RARP table
+static_rarp
+
 # Set static ARP table
 static_arp
-
 }
 
 ######
@@ -109,25 +111,32 @@ set_down_loopback
 # find all the interfaces besides loopback.
 # ignore aliases, alternative configurations, and editor backup files
 interfaces=$((cd /etc/sysconfig/interfaces && ls -1 ifcfg* | \
-       egrep -v '(ifcfg-lo|:)' | egrep 'ifcfg-[a-z0-9]+$' | \
-       awk ' { gsub(/ifcfg-/,NIL); print $0 } ') 2> /dev/null)
+       egrep -v '(ifcfg-lo|:)' | \
+       LANG=C LC_ALL=C egrep 'ifcfg-[a-z0-9]+(\.[0-9]+|)$' | \
+       awk ' { gsub(/ifcfg-/,NIL); print $0 } ' | xargs ) 2> /dev/null)
 interfaces_boot=$((cd /etc/sysconfig/interfaces && ls -1 ifcfg* | \
-       egrep -v '(ifcfg-lo|ifcfg-sit|ifcfg-atm|ifcfg-lec|:)' | egrep 'ifcfg-[a-z0-9]+$' | \
+       egrep -v '(ifcfg-lo|ifcfg-sit|ifcfg-atm|ifcfg-lec|:)' | \
+       LANG=C LC_ALL=C egrep 'ifcfg-[a-z0-9]+$' | \
+       xargs egrep -l "ONBOOT=[^n][^o]" | \
+       awk ' { gsub(/ifcfg-/,NIL); print $0 } ' | xargs ) 2> /dev/null)
+interfaces_vlan_boot=$((cd /etc/sysconfig/interfaces && ls -1 ifcfg-*.* | \
+       LANG=C LC_ALL=C egrep 'ifcfg-[a-z0-9]+\.[0-9]+$' | \
        xargs egrep -l "ONBOOT=[^n][^o]" | \
-       awk ' { gsub(/ifcfg-/,NIL); print $0 } ') 2> /dev/null)
+       awk ' { gsub(/ifcfg-/,NIL); print $0 } ' | xargs ) 2> /dev/null)
 interfaces_sit_boot=$((cd /etc/sysconfig/interfaces && ls -1 ifcfg-sit* | \
-       egrep 'ifcfg-[a-z0-9]+$' | xargs egrep -l "ONBOOT=[^n][^o]" | \
-       awk ' { gsub(/ifcfg-/,NIL); print $0 } ') 2> /dev/null)
+       LANG=C LC_ALL=C egrep 'ifcfg-[a-z0-9]+$' | \
+       xargs egrep -l "ONBOOT=[^n][^o]" | \
+       awk ' { gsub(/ifcfg-/,NIL); print $0 } ' | xargs ) 2> /dev/null)
 tunnels=$((cd /etc/sysconfig/interfaces && ls -1 tnlcfg-* | \
        xargs egrep -l "ONBOOT=[^n][^o]" | \
-       awk ' { gsub(/tnlcfg-/,NIL); print $0 } ') 2> /dev/null)
+       awk ' { gsub(/tnlcfg-/,NIL); print $0 } ' | xargs) 2> /dev/null)
 
 # See how we were called.
 case "$1" in
   start)
        network_init
 
-       for i in $interfaces_boot $interfaces_sit_boot ; do
+       for i in $interfaces_boot $interfaces_vlan_boot $interfaces_sit_boot ; do
                run_cmd -a "$(nls "Bringing up interface") $i" /sbin/ifup $i boot
        done
 
@@ -147,20 +156,15 @@ case "$1" in
   stop)
        # If we go to runlevel 0, 1 or 6 then umount all network fs
        if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then
-               if [ -x /etc/rc.d/init.d/netfs -a -f /var/lock/subsys/netfs ];
-               then
-                       /etc/rc.d/init.d/netfs stop
-               else
-                       netmtab=$(awk '{ if ($3 ~ /^(nfs|smbfs|ncpfs)$/ ) print $3}' /proc/mounts)
-                       if (echo "$netmtab" | grep -q nfs); then
-                          run_cmd "Unmounting NFS filesystems" umount -fat nfs
-                       fi
-                       if (echo "$netmtab" | grep -q smbfs); then
-                          run_cmd "Unmounting SMB filesystems" umount -at smbfs
-                       fi
-                       if (echo "$netmtab" | grep -q ncpfs); then
-                          run_cmd "Unmounting NCP filesystems" umount -at ncpfs
-                       fi
+               netmtab=$(awk '{ if ($3 ~ /^(nfs|smbfs|ncpfs)$/ ) print $3}' /proc/mounts)
+               if (echo "$netmtab" | grep -q nfs); then
+                  run_cmd "Unmounting NFS filesystems" umount -fat nfs
+               fi
+               if (echo "$netmtab" | grep -q smbfs); then
+                  run_cmd "Unmounting SMB filesystems" umount -at smbfs
+               fi
+               if (echo "$netmtab" | grep -q ncpfs); then
+                  run_cmd "Unmounting NCP filesystems" umount -at ncpfs
                fi
        fi
 
@@ -173,16 +177,10 @@ case "$1" in
                run_cmd -a "$(nls "Shutting down interface from LDAP") $i" /sbin/ifdown $i boot
        done
 
-       for i in $interfaces_sit_boot $interfaces_boot ; do
+       for i in $interfaces_sit_boot $interfaces_vlan_boot $interfaces_boot ; do
                run_cmd -a "$(nls "Shutting down interface") $i" /sbin/ifdown $i boot
        done
 
-       for i in $(ip link show | awk -F":" ' (/UP/) && ($2 !~ "lo") { gsub(/@.*/,NIL); print $2; } ') ; do
-               show "Shutting down unconfigured interface %s" "$i"
-               ip addr flush dev $i 2>&1 | grep -v "Nothing to flush"
-               if (ip link set $i down); then ok; else fail; fi
-       done
-
        network_deinit
 
         rm -f /var/lock/subsys/network
This page took 0.05087 seconds and 4 git commands to generate.