aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2001-11-19 13:36:48 +0000
committerHarald Hoyer <harald@redhat.com>2001-11-19 13:36:48 +0000
commita5780b11169d7c6b50c23ace18acc8310df21da5 (patch)
treeb9d25eefd5aab558764e5f25b4598af1c5e8b574 /rc.d
parent8439a7aa971d7a5b2bbc6b8339a32c3eadaf7e9e (diff)
downloadinitscripts-a5780b11169d7c6b50c23ace18acc8310df21da5.tar
initscripts-a5780b11169d7c6b50c23ace18acc8310df21da5.tar.gz
initscripts-a5780b11169d7c6b50c23ace18acc8310df21da5.tar.bz2
initscripts-a5780b11169d7c6b50c23ace18acc8310df21da5.tar.xz
initscripts-a5780b11169d7c6b50c23ace18acc8310df21da5.zip
determine devices the correct way
Diffstat (limited to 'rc.d')
-rwxr-xr-xrc.d/init.d/network19
1 files changed, 11 insertions, 8 deletions
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