]> git.pld-linux.org Git - projects/rc-scripts.git/blobdiff - sysconfig/network-scripts/ifup-routes
- merge from TOTALNEW branch (see NEWS for more info)
[projects/rc-scripts.git] / sysconfig / network-scripts / ifup-routes
index 5f4d7a9b1fb22cd9f1f8899ce514d80943ba84ab..69ce13aad3fbfc908629e28306f4bd454cee89ad 100755 (executable)
@@ -1,11 +1,17 @@
 #!/bin/sh
 #
-#      $Id: ifup-routes,v 1.8 2000/04/21 17:47:49 jajcus Exp $
+#      $Id: ifup-routes,v 1.9 2001/05/15 16:03:44 baggins Exp $
 #
 # adds static routes which go through device $DEVICE
 
-if [ "$1" = "" ]; then
-       echo "usage: $0 <net-device>"
+. /etc/sysconfig/network
+. /etc/rc.d/init.d/functions
+. /etc/sysconfig/network-scripts/.functions
+
+DEV=$1
+
+if [ -z "$DEV" ]; then
+       nls "usage: %s <device name>" "ifup-routes" >&2
        exit 1
 fi
 
@@ -13,16 +19,33 @@ if [ ! -f /etc/sysconfig/static-routes ]; then
        exit 0
 fi
 
-cd /etc/sysconfig/network-scripts
-. /etc/rc.d/init.d/functions
-. /etc/sysconfig/network-scripts/.functions
-CONFIG=$1
+if [ -f "/etc/sysconfig/interfaces/ifcfg-$DEV" ] ; then
+        CONFIG="/etc/sysconfig/interfaces/ifcfg-$DEV"
+else
+        CONFIG="$DEV"
+fi
+               
 source_config
 
+# set all major variables
+setup_ip_param
+
 get_ppp_device_and_pid
 
 # note the trailing white space character in the grep gets rid of aliases
 grep "^$DEVICE[[:blank:]]" /etc/sysconfig/static-routes | while read device args; do
+       if (echo $args | grep -q ":") then
+               if is_no "$IPV6_NETWORKING"; then
+                       continue
+               fi
+       else
+               if is_no "$IPV4_NETWORKING"; then
+                       continue
+               fi
+       fi
        /sbin/ip route add $args dev $REALDEVICE
 done
 
+
+# This must be last line !
+# vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.109008 seconds and 4 git commands to generate.