aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup-routes
blob: b623cfd932f082df064e54f3451f12b4593aca8b (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
#!/bin/sh

# adds static routes which go through device $1

if [ "$1" = "" ]; then
	echo "usage: $0 <net-device>"
	exit 1
fi

# don't run linuxconf if /usr isn't there
#if [ -x /bin/linuxconf -a -f /usr/lib/libncurses.so.4.2 ] ; then
#	linuxconf --hint routing "$1" | while read args; do
#	    /sbin/route $args
#	done
#else
	if [ ! -f /etc/sysconfig/static-routes ]; then
		exit 0
	fi

	#note the trailing space in the grep gets rid of aliases
	grep "^$1 " /etc/sysconfig/static-routes | while read device args; do
	    /sbin/route add -$args $device
	done
#fi