--- network_original	2007-03-24 23:28:39.000000000 +0100
+++ network	2007-03-24 23:07:26.000000000 +0100
@@ -164,6 +164,7 @@
 			exit
 		fi
 
+		
 		# See if we're using network profiles
 		if [ "$NET" ]; then
 			# This env var is passed from the kernel boot line
@@ -176,11 +177,27 @@
 			if [ "$NET_PROFILES" = "menu" ]; then
 				/usr/bin/netcfg --menu --timeout 5
 			else
+				OR_NET_PROFILES=() 
 				for prof in ${NET_PROFILES[@]}; do
 					if [ "$prof" = "${prof#!}" ]; then
-						/usr/bin/netcfg -c $prof
+						# If profile is not in or list start it
+						if [ "$prof" = "${prof#:}" ]; then
+							/usr/bin/netcfg -c $prof
+					 	else
+							OR_NET_PROFILES=(${OR_NET_PROFILES[@]} ${prof#:})
+						fi
 					fi
 				done
+				# tries to start one network profile after the other, and stopps
+				# trying at success
+				for prof in ${OR_NET_PROFILES[@]}; do
+					 PROF_DEVICE=$(sed -n "s/^INTERFACE=\(.*\)/\1/p" /etc/network-profiles/$prof)
+					 ifconfig $PROF_DEVICE up
+					 if [ ! "$(mii-tool $PROF_DEVICE 2>/dev/null|grep "no link")" ]; then
+						 	/usr/bin/netcfg -c $prof && break
+					 fi
+					 ifconfig $PROF_DEVICE down
+			  done
 			fi
 		fi
 
