aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig')
-rwxr-xr-xsysconfig/network-scripts/ifup-aliases36
1 files changed, 30 insertions, 6 deletions
diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases
index 40d27f7d..277fd6f0 100755
--- a/sysconfig/network-scripts/ifup-aliases
+++ b/sysconfig/network-scripts/ifup-aliases
@@ -255,11 +255,6 @@ function new_interface ()
if [ "$NO_ALIASROUTING" != yes ]; then
- # this is broken! it's only here for compatibility with old RH systems
- if [ "${GATEWAY}" != "" -a "${GATEWAY}" != "none" ]; then
- route add default gw ${GATEWAY} metric 1 ${DEVICE}
- fi
-
GATEWAY=$network_GATEWAY;
GATEWAYDEV=$network_GATEWAYDEV;
@@ -291,11 +286,38 @@ function new_interface ()
if [ "$BASH_VERSINFO" ]; then shopt -s nullglob; else allow_null_glob_expansion=foo; fi
+# Is there any linuxconf-style alias files.
+linuxconfstyle=0
for FILE in ifcfg-${parent_device}:* ; do
+
ini_env;
. $FILE;
- new_interface;
+ if [ -z "$DEVICE" ]; then
+ # it's a linuxconf file.
+ # I don't think this script will handle both style correctly
+ # though. Well, those who knows about the other style don't know
+ # the other style and vice versa
+ linuxconfstyle=1
+ else
+ new_interface;
+ fi
done
+if [ "$linuxconfstyle" = "1" ] ; then
+ linuxconf --hint ipalias $device \
+ | while read command ali ip mask bcast
+ do
+ if [ "$command" = "del" ] ; then
+ /sbin/ifconfig $ali down
+ do_netreport=yes
+ elif [ "$command" = "add" ] ; then
+ /sbin/ifconfig $ali $ip netmask $mask broadcast $bcast
+ do_netreport=yes
+ else
+ echo Incomatible hinting: $command $rest >&2
+ fi
+ done
+fi
+
for FILE in ifcfg-${parent_device}-range* ; do
@@ -330,6 +352,7 @@ done
#
# Remove any devices that should not be around
#
+if [ "$linuxconfstyle" = "0" ] ; then
for DEVNUM in $rdev_LIST ; do
eval " rdev_mark=\$rdev_${DEVNUM}_mark ";
if [ -z "$rdev_mark" ]; then
@@ -338,6 +361,7 @@ done
do_netreport=yes
fi
done
+fi
#
# Notify of new device creation
#