aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsysconfig/network-scripts/ifup-aliases24
1 files changed, 9 insertions, 15 deletions
diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases
index 7e06b489..7fbaf108 100755
--- a/sysconfig/network-scripts/ifup-aliases
+++ b/sysconfig/network-scripts/ifup-aliases
@@ -2,7 +2,8 @@
# adds aliases of device $1
-if [ "$1" = "" ]; then
+device=$1
+if [ "$device" = "" ]; then
echo "usage: $0 <net-device>"
exit 1
fi
@@ -38,19 +39,12 @@ if [ -x /bin/linuxconf -a -f /usr/lib/libncurses.so.4.2 ] ; then
else
# we don't have linuxconf to fall back on, so presumably we do
# not have to parse linuxconf ipalias ranges, either.
-
- # bash 2 is so much fun.
- if [ "$BASH_VERSINFO" ]; then
- shopt -s nullglob
- else
- allow_null_glob_expansion=foo
- fi
- for alias in /etc/sysconfig/network-scripts/ifcfg-$1:* ; do
- [ -f $alias ] && /etc/sysconfig/network-scripts/ifup $alias
+ current=0
+ while : ; do
+ if [ ! -f /etc/sysconfig/network-scripts/$device:$current ]; then
+ return
+ fi
+ /etc/sysconfig/network-scripts/ifup $device:$current
+ current=`expr $current + 1`
done
- if [ "$BASH_VERSINFO" ]; then
- shopt -u nullglob
- else
- unset allow_null_glob_expansion
- fi
fi