r2392 - / trunk/bootscripts trunk/bootscripts/lfs/sysconfig/network-devices

jim at linuxfromscratch.org jim at linuxfromscratch.org
Sun Sep 3 00:48:23 PDT 2006


Author: jim
Date: 2006-09-03 01:48:22 -0600 (Sun, 03 Sep 2006)
New Revision: 2392

Modified:
   /
   trunk/bootscripts/
   trunk/bootscripts/Changelog
   trunk/bootscripts/lfs/sysconfig/network-devices/ifup
Log:
 r5522 at server (orig r2530):  jim | 2006-09-02 23:02:35 -0700
  r5521 at server:  jim | 2006-09-02 23:02:09 -0700
  Added check to make sure interface is not configured
 



Property changes on: 
___________________________________________________________________
Name: svk:merge
   - b6734a72-470d-0410-b049-f317dca95413:/:2529
   + b6734a72-470d-0410-b049-f317dca95413:/:2530


Property changes on: trunk/bootscripts
___________________________________________________________________
Name: svk:merge
   - 38c7b366-470d-0410-a457-935707c16d9b:/bootscripts:5255
3949c430-d905-0410-97b6-f115d20341b5:/bootscripts:1331
3b7552df-c20a-0410-b7e1-d7eaf1be8828:/bootscripts:1109
   + 38c7b366-470d-0410-a457-935707c16d9b:/bootscripts:5521
3949c430-d905-0410-97b6-f115d20341b5:/bootscripts:1331
3b7552df-c20a-0410-b7e1-d7eaf1be8828:/bootscripts:1109

Modified: trunk/bootscripts/Changelog
===================================================================
--- trunk/bootscripts/Changelog	2006-09-02 19:50:10 UTC (rev 2391)
+++ trunk/bootscripts/Changelog	2006-09-03 07:48:22 UTC (rev 2392)
@@ -1,3 +1,6 @@
+n/a - September 2, 2006
+        * Add a check to see if the interface is already setup
+
 jim - August 27, 2006
 	* Added the same change to ifdown script. 
 

Modified: trunk/bootscripts/lfs/sysconfig/network-devices/ifup
===================================================================
--- trunk/bootscripts/lfs/sysconfig/network-devices/ifup	2006-09-02 19:50:10 UTC (rev 2391)
+++ trunk/bootscripts/lfs/sysconfig/network-devices/ifup	2006-09-03 07:48:22 UTC (rev 2392)
@@ -62,17 +62,24 @@
 
 		if [ -n "${SERVICE}" -a -x "${network_devices}/services/${SERVICE}" ]; then
 			if [ -z "${CHECK_LINK}" -o "${CHECK_LINK}" = "y" -o "${CHECK_LINK}" = "yes" -o "${CHECK_LINK}" = "1" ]; then
-				if ip link show ${1} > /dev/null 2>&1; then
-					link_status=`ip link show ${1} 2> /dev/null | grep ${1}`
-					if [ -n "${link_status}" ]; then
-						if ! echo "${link_status}" | grep -q UP; then
-							ip link set ${1} up
+				TEST="`ip addr show ${1} | grep inet | cut -f1 -d'/' | cut -f2 -d't' | cut -f2 -d' '`"
+				if [ "$TEST" != "" ]; then
+						boot_mesg "Interface ${1} already configured." ${WARNING}
+						echo_warning
+						continue
+				else
+					if ip link show ${1} > /dev/null 2>&1; then
+						link_status=`ip link show ${1} 2> /dev/null | grep ${1}`
+						if [ -n "${link_status}" ]; then
+							if ! echo "${link_status}" | grep -q UP; then
+								ip link set ${1} up
+							fi
 						fi
+					else
+						boot_mesg "Interface ${1} doesn't exist." ${WARNING}
+						echo_warning
+						continue
 					fi
-				else
-					boot_mesg "Interface ${1} doesn't exist." ${WARNING}
-					echo_warning
-					continue
 				fi
 			fi
 			IFCONFIG=${file} ${network_devices}/services/${SERVICE} ${1} up




More information about the cross-lfs mailing list