From a5780b11169d7c6b50c23ace18acc8310df21da5 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 19 Nov 2001 13:36:48 +0000 Subject: determine devices the correct way --- rc.d/init.d/network | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'rc.d/init.d/network') diff --git a/rc.d/init.d/network b/rc.d/init.d/network index a185b934..1c8b8b2e 100755 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -47,8 +47,7 @@ cd /etc/sysconfig/network-scripts # ignore aliases, alternative configurations, and editor backup files interfaces=`ls ifcfg* | LANG=C egrep -v '(ifcfg-lo|:|rpmsave|rpmorig|rpmnew)' | \ LANG=C egrep -v '(~|\.bak)$' | \ - LANG=C egrep -v 'ifcfg-cipcb[0-9]+$' | \ - LANG=C egrep 'ifcfg-[a-z0-9]+$' | \ + LANG=C egrep 'ifcfg-[A-Za-z0-9_-]+$' | \ sed 's/^ifcfg-//g'` # See how we were called. @@ -80,10 +79,15 @@ case "$1" in awk '{ print $3 }' 2>/dev/null` sysctl -w kernel.hotplug="/bin/true" > /dev/null 2>&1 + cipeinterfaces="" + # bring up all other interfaces configured to come up at boot time for i in $interfaces; do - if [ "${i##eth}" != "$i" ] && ! is_available $i ; then - continue + eval $(fgrep "DEVICE=" ifcfg-$i) + if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi + + if [ "${DEVICE##cipcb}" != "$DEVICE" ] ; then + cipeinterfaces="$cipeinterfaces $DEVICE" fi if LANG=C egrep -L "^ONBOOT=\"?[Nn][Oo]\"?" ifcfg-$i > /dev/null ; then continue @@ -109,10 +113,6 @@ case "$1" in done # Bring up CIPE VPN interfaces - cipeinterfaces=`ls ifcfg* | LANG=C egrep -v '(ifcfg-lo|:|rpmsave|rpmorig|rpmnew)' | \ - LANG=C egrep -v '(~|\.bak)$' | \ - LANG=C egrep 'ifcfg-cipcb[0-9]+$' | \ - sed 's/^ifcfg-//g'` for i in $cipeinterfaces ; do if ! LANG=C egrep -L "^ONBOOT=\"?[Nn][Oo]\"?" ifcfg-$i >/dev/null 2>&1 ; then # If we're in confirmation mode, get user confirmation @@ -175,6 +175,9 @@ case "$1" in # shut down all interfaces (other than loopback) for i in $interfaces ; do + eval $(fgrep "DEVICE=" ifcfg-$i) + if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi + if ! check_device_down $i; then action $"Shutting down interface $i: " ./ifdown $i boot fi -- cgit v1.2.1