]> git.pld-linux.org Git - projects/rc-scripts.git/blob - sysconfig/network-scripts/ifup-routes
- static arp per interface support
[projects/rc-scripts.git] / sysconfig / network-scripts / ifup-routes
1 #!/bin/sh
2 #
3 #       $Id: ifup-routes,v 1.14 2002/08/11 17:05:09 misiek Exp $
4 #
5 # adds static routes which go through device $DEVICE
6
7 . /etc/sysconfig/network
8 . /etc/rc.d/init.d/functions
9 . /etc/sysconfig/network-scripts/functions.network
10
11 DEV=$1
12
13 if [ -z "$DEV" ]; then
14         nls "Usage: %s <device name>" "ifup-routes" >&2
15         exit 1
16 fi
17
18 if [ ! -f /etc/sysconfig/static-routes ]; then
19         exit 0
20 fi
21
22 if [ -f "/etc/sysconfig/interfaces/ifcfg-$DEV" ] ; then
23         CONFIG="/etc/sysconfig/interfaces/ifcfg-$DEV"
24 else
25         CONFIG="$DEV"
26 fi
27                 
28 source_config
29
30 # set all major variables
31 setup_ip_param
32
33 get_ppp_device_and_pid
34
35 # note the trailing white space character in the grep gets rid of aliases
36 egrep "^($DEVICE|any)[[:blank:]]" /etc/sysconfig/static-routes | while read device args; do
37         if (echo $args | grep -q ":") then
38                 if is_no "$IPV6_NETWORKING"; then
39                         continue
40                 fi
41         else
42                 if is_no "$IPV4_NETWORKING"; then
43                         continue
44                 fi
45         fi
46         /sbin/ip route add $args dev $REALDEVICE
47 done
48
49
50 # This must be last line !
51 # vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.024835 seconds and 3 git commands to generate.