From 9a856ea3faac5ae432474cea7bf1e58730300169 Mon Sep 17 00:00:00 2001 From: Florian La Roche Date: Fri, 5 Jul 2002 08:05:01 +0000 Subject: - no need to source the file /etc/init.d/functions - cleanups --- sysconfig/network-scripts/ifup-routes | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'sysconfig') diff --git a/sysconfig/network-scripts/ifup-routes b/sysconfig/network-scripts/ifup-routes index 1734e9e2..657aa661 100755 --- a/sysconfig/network-scripts/ifup-routes +++ b/sysconfig/network-scripts/ifup-routes @@ -1,25 +1,20 @@ -#!/bin/bash +#! /bin/bash +# # adds static routes which go through device $1 -. /etc/init.d/functions - -if [ "$1" = "" ]; then - echo $"usage: ifup-routes " - exit 1 -fi - -if [ ! -f /etc/sysconfig/network-scripts/route-$1 ]; then - exit 0 +if [ -z "$1" ]; then + echo $"usage: ifup-routes " + exit 1 fi -DEVICE=$1 +[ -f "/etc/sysconfig/network-scripts/route-$1" ] || exit 0 -# Only use the new route-DEV style. -cat "/etc/sysconfig/network-scripts/route-$DEVICE" | while read line; do +while read line; do /sbin/ip route add $line -done +done < "/etc/sysconfig/network-scripts/route-$1" -#grep "^$DEVICE[[:space:]]" /etc/sysconfig/static-routes | while read device args; do +# XXX old version: +#grep "^$1[[:space:]]" /etc/sysconfig/static-routes | while read device args; do # /sbin/route add -$args $device #done #grep "^any[[:space:]]" /etc/sysconfig/static-routes | while read ignore args ; do -- cgit v1.2.1