Submitted By: Michael Labuschke (michael at labuschke dot de)
Date: 2005-10-27
Initial Package Version: lfs-bootscripts-3.2.1
Origin: me
Upstream Status: hereby sent ;) 
Description: sometimes you need to restart only one interface and leave the rest up.
you can now pass extra args to only start/stop/restart single or multiple interfaces.
 
diff -Naur lfs-bootscripts-3.2.1.orig/lfs/init.d/network lfs-bootscripts-3.2.1/lfs/init.d/network
--- lfs-bootscripts-3.2.1.orig/lfs/init.d/network	2005-03-31 06:15:59.000000000 +0000
+++ lfs-bootscripts-3.2.1/lfs/init.d/network	2005-10-26 23:48:20.000000000 +0000
@@ -20,8 +20,20 @@
 
 case "${1}" in
 	start)
-		# Start all network interfaces
-		for file in ${network_devices}/ifconfig.*
+		if [ "$*" == "start" ]
+		then # if no extra args are passed start all interfaces
+		    FILES=""
+		    for file in ${network_devices}/ifconfig.*
+		    do
+			FILES="${FILES} ${file}"
+		    done
+		else # start only extra given interfaces
+		    shift
+		    FILES="$*"
+		fi
+
+		# Start network interfaces
+		for file in ${FILES}
 		do
 			interface=${file##*/ifconfig.}
 
@@ -36,14 +48,20 @@
 		;;
 
 	stop)
-		# Reverse list
-		FILES=""
-		for file in ${network_devices}/ifconfig.*
-		do
+		if [ "$*" == "start" ]
+		then # if no extra args are passed stop all interfaces
+	    	    # Reverse list
+		    FILES=""
+		    for file in ${network_devices}/ifconfig.*
+		    do
 			FILES="${file} ${FILES}"
-		done
+		    done
+		else # stop only extra given interfaces
+		    shift
+		    FILES="$*"
+		fi
 
-		# Stop all network interfaces
+		# Stop network interfaces
 		for file in ${FILES}
 		do
 			interface=${file##*/ifconfig.}
@@ -59,9 +77,10 @@
 		;;
 
 	restart)
-		${0} stop
+		shift
+		${0} stop $*
 		sleep 1
-		${0} start
+		${0} start $*
 		;;
 
 	*)
