[Lunar-commits] CVS: moonbase/net/net-tools/init.d network, 1.10, 1.11

Auke Kok sofar at lunar-linux.org
Wed Oct 6 16:05:55 UTC 2004


Update of /var/cvs/lunar/moonbase/net/net-tools/init.d
In directory espresso.foo-projects.org:/tmp/cvs-serv20079

Modified Files:
	network 
Log Message:
Adding the final (tested) support for extra route commands in cooperation with lnet. This will allow you to add post-ifconfig route commands in a more complext routing setup.


Index: network
===================================================================
RCS file: /var/cvs/lunar/moonbase/net/net-tools/init.d/network,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- network	5 Oct 2004 08:24:44 -0000	1.10
+++ network	6 Oct 2004 16:05:51 -0000	1.11
@@ -135,6 +135,12 @@
 		    echo -n "failed to set address";
 		    return -1;
 		fi;
+		for ROUTECMD in "$ROUTE_1" "$ROUTE_2" "$ROUTE_3" "$ROUTE_4" ; do
+		  if [ -n "$ROUTECMD" ] ; then
+	            echo -e "\n    adding route: $ROUTECMD"
+		    /sbin/route $ROUTECMD
+		  fi
+		done
 	    ;;
 	    *)
 		echo -n "address type not currently supported";
@@ -152,6 +158,17 @@
 
 	. $CONFIGS/$1;
 	
+	for ROUTECMD in "$ROUTE_4" "$ROUTE_3" "$ROUTE_2" "$ROUTE_1" ; do
+	  if [ -n "$ROUTECMD" ] ; then
+	    if $(echo $ROUTECMD | grep -q "^add ") ; then
+	      ROUTECMD=$(echo $ROUTECMD | sed 's/^add /del /')
+	    elif $(echo $ROUTECMD | grep -q "^del ") ; then
+	      ROUTECMD=$(echo $ROUTECMD | sed 's/^del /add /')
+	    fi
+	    echo -e "\n    deleting route: $ROUTECMD"
+	    /sbin/route $ROUTECMD
+	  fi
+	done
 	case $ADDRESS in
 	    [dD][hH][cC][pP])
 	        case $DHCP_CLIENT in



More information about the Lunar-commits mailing list