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

Auke Kok sofar at lunar-linux.org
Sun Mar 13 22:29:38 UTC 2005


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

Modified Files:
	network 
Log Message:
Fix for 2 bugs:

1) the missing ')' due to bash somehow handling regex patterns differently since 3.0
2) default route NOW REALLY ONLY APPLIES FOR THE DEFAULT ROUTE, and not for gatewayed host entries (always check that the 'destination == 0.0.0.0').


Index: network
===================================================================
RCS file: /var/cvs/lunar/moonbase/net/net-tools/init.d/network,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- network	17 Jan 2005 09:01:03 -0000	1.13
+++ network	13 Mar 2005 22:29:35 -0000	1.14
@@ -114,7 +114,7 @@
 		    fi;
 		fi;
 	    ;;
-	    ?([0-9])?([0-9])[0-9].?([0-9])?([0-9])[0-9].?([0-9])?([0-9])[0-9].?([0-9])?([0-9])[0-9])
+	    *)
 		if [ ! -x /sbin/ifconfig ]; then
 		    echo -n "ifconfig not installed";
 		    return -1;
@@ -142,10 +142,6 @@
 		  fi
 		done
 	    ;;
-	    *)
-		echo -n "address type not currently supported";
-		return -3;
-	    ;;
 	esac
 	return 0;
 };
@@ -207,7 +203,7 @@
 		    esac
 	        fi;
 	    ;;
-	    ?([0-9])?([0-9])[0-9].?([0-9])?([0-9])[0-9].?([0-9])?([0-9])[0-9].?([0-9])?([0-9])[0-9])
+	    *)
 		if [ `ifconfig | grep $1 | wc -l` -eq 1 ]; then
 		    if [ ! -x /sbin/ifconfig ]; then
 	    	   	echo -n "ifconfig not installed";
@@ -223,9 +219,6 @@
 		    esac
 		fi;
 	    ;;
-	    *)
-	    	/sbin/ifconfig $1 down
-	    ;;
 	esac
 	
 	if [ -n "$MODULE" ]; then
@@ -255,7 +248,7 @@
 	    done;
 	    if [ -e /etc/config.d/gateway ]; then
 	       GATEWAY=`cat /etc/config.d/gateway`
-	       if [ -n "$GATEWAY" ] && ! $(route -n | grep -qw UG) ; then
+	       if [ -n "$GATEWAY" ] && ! $(route -n | "^0\.0\.0\.0.*UG.*$") ; then
 	           echo -n " * setting default route: "
 	           if [ ! -x /sbin/route ]; then
 	            echo -n "route not installed";



More information about the Lunar-commits mailing list