diff options
Diffstat (limited to 'sysconfig')
-rwxr-xr-x | sysconfig/network-scripts/ifup-routes | 25 |
1 files changed, 10 insertions, 15 deletions
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 <net-device>" - exit 1 -fi - -if [ ! -f /etc/sysconfig/network-scripts/route-$1 ]; then - exit 0 +if [ -z "$1" ]; then + echo $"usage: ifup-routes <net-device>" + 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 |