]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- policy routing support
authorwojrus <wojrus@pld-linux.org>
Fri, 29 Mar 2002 08:45:17 +0000 (08:45 +0000)
committerwojrus <wojrus@pld-linux.org>
Fri, 29 Mar 2002 08:45:17 +0000 (08:45 +0000)
svn-id: @1005

rc-scripts.spec.in
rc.d/init.d/functions.network
rc.d/init.d/network
sysconfig/Makefile.am

index 94c0ea3e34f929f4d9cb5c4b0b479115c42898f9..8dbf2673b48628cd238b0fc60b29d617247f2511 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: rc-scripts.spec.in,v 1.52 2001/05/15 16:03:33 baggins Exp $
+# $Id: rc-scripts.spec.in,v 1.53 2002/03/29 08:45:10 wojrus Exp $
 Summary:       inittab and /etc/rc.d scripts
 Summary(de):   inittab und /etc/rc.d Scripts
 Summary(fr):   inittab et scripts /etc/rc.d
@@ -208,7 +208,7 @@ fi
 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sysconfig/network
 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sysconfig/static-routes
 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sysconfig/static-nat
-%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sysconfig/timezone
+%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sysconfig/ip-rules
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/adjtime
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/inittab
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/initlog.conf
index 37227b7f9e904de21e03ac96344f693d0a70d754..b9f1da325ad17f9087fe7d5019f8e88637f9f63f 100755 (executable)
@@ -1,5 +1,5 @@
 #
-# $Id: functions.network,v 1.68 2002/02/03 16:14:32 adasi Exp $
+# $Id: functions.network,v 1.69 2002/03/29 08:45:14 wojrus Exp $
 # 
 # This is not a shell script; it provides functions to network scripts
 # that source it.
@@ -504,6 +504,22 @@ if [ -z "$REALDEVICE" ] ; then
        REALDEVICE=$DEVICE
 fi
 }
+# following function setups advanced routing rules
+# Olgierd Pieczul <wojrus@pld.org.pl>
+setup_ip_rules () {
+typeset args
+if [ -f /etc/sysconfig/ip-rules ] ; then
+        if [ "$1" = "on" -o "$1" = "yes" ] ; then
+                egrep "^(from|to|iif|tos|fwmark|dev|pref)[[:blank:]]" /etc/sysconfig/ip-rules | while read args; do
+                        /sbin/ip rule add $args
+                done
+        else
+                egrep "^(from|to|iif|tos|fwmark|dev|pref)[[:blank:]]" /etc/sysconfig/ip-rules | while read args; do
+                        /sbin/ip rule del $args
+                done
+        fi
+fi
+}
 
 # This must be last line !
 # vi:syntax=sh:tw=78:ts=8:sw=4
index f42c920618dc4b53c92c788d4b59ff3f03aaec1d..2e8525d58474d1fc80db83f7129dd80032d19ace 100644 (file)
@@ -8,7 +8,7 @@
 #
 # probe:       true
 
-# $Id: network,v 1.52 2002/03/07 11:16:36 blues Exp $
+# $Id: network,v 1.53 2002/03/29 08:45:14 wojrus Exp $
 
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 
@@ -67,6 +67,7 @@ set_up_loopback
 setup_forwarding on
 setup_nat on
 setup_routes on
+setup_ip_rules on
 # Setup IPX
 if is_yes "$IPX"; then
        if [ -n $IPXAUTOPRIMARY ] ; then
@@ -107,6 +108,7 @@ network_deinit()
 {
 setup_forwarding off
 setup_routes off
+setup_ip_rules off
 
 # Set down NAT rules
 setup_nat off
index ac77d046fa5407023a274b512098361e7e1e0108..7572b5a043cb04cc09a9044320200ffbc72af5b8 100644 (file)
@@ -12,6 +12,7 @@ sysconfig_DATA = \
        static-routes \
        static-nat \
        i18n \
-       timezone
+       timezone \
+       ip-rules
 
 EXTRA_DIST = $(sysconfig_DATA)
This page took 0.365257 seconds and 4 git commands to generate.