From e956fb172d00dc564cc50f2a33a0feb9ddd53839 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Wed, 28 May 2003 18:53:50 +0000 Subject: - make usernetctl use the nickname instead of the device name - don't look in /etc/sysconfig/networking - fix calling of nameif before the device was loaded - clean up route handling () --- sysconfig/network-scripts/ifup-routes | 37 ++++++++++++++++------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'sysconfig/network-scripts/ifup-routes') diff --git a/sysconfig/network-scripts/ifup-routes b/sysconfig/network-scripts/ifup-routes index a1d1ae3b..5a11f4a7 100755 --- a/sysconfig/network-scripts/ifup-routes +++ b/sysconfig/network-scripts/ifup-routes @@ -2,7 +2,7 @@ # # adds static routes which go through device $1 if [ -z "$1" ]; then - echo $"usage: ifup-routes " + echo $"usage: ifup-routes []" exit 1 fi @@ -22,22 +22,19 @@ if [ -n "$2" -a "$2" != "$1" ]; then fi # Red Hat network configuration format - -CONFIG="/etc/sysconfig/networking/devices/$1.route" -[ -f $CONFIG ] || CONFIG="/etc/sysconfig/networking/devices/$2.route" -[ -f $CONFIG ] || exit 0 - -. $CONFIG - -routenum=0 -while [ "x$(eval echo '$'ADDRESS$routenum)x" != "xx" ]; do - eval `ipcalc -p $(eval echo '$'ADDRESS$routenum) $(eval echo '$'NETMASK$routenum)` - line="$(eval echo '$'ADDRESS$routenum)/$PREFIX" - if [ "x$(eval echo '$'GATEWAY$routenum)x" != "xx" ]; then - line="$line via $(eval echo '$'GATEWAY$routenum)" - fi - line="$line dev $1" - /sbin/ip route add $line - routenum=$(($routenum+1)) -done - +NICK=${2:-$1} +CONFIG="/etc/sysconfig/network-scripts/$NICK.route" +if [ -f $CONFIG ]; then + . $CONFIG + routenum=0 + while [ "x$(eval echo '$'ADDRESS$routenum)x" != "xx" ]; do + eval `ipcalc -p $(eval echo '$'ADDRESS$routenum) $(eval echo '$'NETMASK$routenum)` + line="$(eval echo '$'ADDRESS$routenum)/$PREFIX" + if [ "x$(eval echo '$'GATEWAY$routenum)x" != "xx" ]; then + line="$line via $(eval echo '$'GATEWAY$routenum)" + fi + line="$line dev $1" + /sbin/ip route add $line + routenum=$(($routenum+1)) + done +fi -- cgit v1.2.1