From 8db687d270a970287933e4abcfbb85b80ad37c8f Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 12 Nov 2002 06:42:07 +0000 Subject: fix static route brokenness (#74317, #74320, #76619, #75604) --- sysconfig/network-scripts/ifup-routes | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'sysconfig') diff --git a/sysconfig/network-scripts/ifup-routes b/sysconfig/network-scripts/ifup-routes index f6734375..912c9bba 100755 --- a/sysconfig/network-scripts/ifup-routes +++ b/sysconfig/network-scripts/ifup-routes @@ -6,12 +6,20 @@ if [ -z "$1" ]; then exit 1 fi +# Older format +if [ -f "/etc/sysconfig/network-scripts/route-$1" ]; then + while read line; do + /sbin/ip route add $line + done < "/etc/sysconfig/network-scripts/route-$1" +fi + +# Red Hat network configuration format + CONFIG="/etc/sysconfig/networking/devices/$1.route" [ -f $CONFIG ] || exit 0 . $CONFIG -# Red Hat network configuration format routenum=0 while [ "x$(eval echo '$'ADDRESS$routenum)x" != "xx" ]; do @@ -25,7 +33,3 @@ while [ "x$(eval echo '$'ADDRESS$routenum)x" != "xx" ]; do routenum=$(($routenum+1)) done -# Older format -while read line; do - /sbin/ip route add $line -done < "/etc/sysconfig/network-scripts/route-$1" -- cgit v1.2.1