aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup-routes
blob: c997a68d73f130584c931e3d5a825e715582b39f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/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
fi

DEVICE=$1

# Only use the new route-DEV style.
cat "/etc/sysconfig/network-scripts/route-$DEVICE" | while read line; do
    echo "/sbin/ip route add $line"
done

#grep "^$DEVICE[[: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
#        /sbin/route add -$args
#done