From 188cd3c51890943d2c715b60730a2b1437111226 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 5 Mar 2001 20:32:23 +0000 Subject: - don't attempt to work around broken linuxconf routes, simplify (and make consistent) adding of static routes, and make it work again for aliases (#29500, #29549) --- rc.d/init.d/network | 8 ++------ sysconfig/network-scripts/ifup-routes | 10 +++------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/rc.d/init.d/network b/rc.d/init.d/network index c022b7a0..60e378f6 100755 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -103,12 +103,8 @@ case "$1" in # Add non interface-specific static-routes. if [ -f /etc/sysconfig/static-routes ]; then - grep "^any" /etc/sysconfig/static-routes | while read ignore type dest netmask mask bogus args; do - if [ "${bogus}" = "gw" ]; then - /sbin/route add -$type $dest $netmask $mask $args - else - /sbin/route add -$type $dest $netmask $mask $bogus $args - fi + grep "^any" /etc/sysconfig/static-routes | while read ignore args ; do + /sbin/route add -$args done fi diff --git a/sysconfig/network-scripts/ifup-routes b/sysconfig/network-scripts/ifup-routes index 580b4d6e..61e209c9 100755 --- a/sysconfig/network-scripts/ifup-routes +++ b/sysconfig/network-scripts/ifup-routes @@ -15,13 +15,9 @@ if [ ! -f /etc/sysconfig/static-routes ]; then fi #note the trailing space in the grep gets rid of aliases -grep "^$1 " /etc/sysconfig/static-routes | while read device args; do +grep "^$DEVICE " /etc/sysconfig/static-routes | while read device args; do /sbin/route add -$args $device done -grep "^any " /etc/sysconfig/static-routes | while read ignore type net netmask mask gw dev ; do - if [ "$dev" = "$1" ]; then - /sbin/route add -$type $net $netmask $mask $dev - elif [ "$gw" = "gw" ]; then - /sbin/route add -$type $net $netmask $mask $gw $dev - fi +grep "^any " /etc/sysconfig/static-routes | while read ignore args ; do + /sbin/route add -$args done -- cgit v1.2.1