From 216580d50e82980deda18eabe32f6f1705c3d7bd Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Mon, 23 Jan 2012 23:10:32 -0500 Subject: [PATCH] network-startup: Bring up only DHCP up to two interfaces - switch and ethX.. Signed-off-by: Konrad Rzeszutek Wilk --- root_image/etc/init.d/primary_network | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/root_image/etc/init.d/primary_network b/root_image/etc/init.d/primary_network index 5fe282d..8f2a057 100755 --- a/root_image/etc/init.d/primary_network +++ b/root_image/etc/init.d/primary_network @@ -16,6 +16,7 @@ echo "DEVICE=$NIC" > $FILE echo "ONBOOT=yes" >> $FILE echo "BRIDGE=switch" >> $FILE +COUNT=0 NICS=`ls -1 /sys/class/net/ | grep -v lo | grep -v sit` # The rest for NIC in $NICS @@ -26,7 +27,12 @@ do FILE=/etc/sysconfig/network-scripts/ifcfg-$NIC echo "DEVICE=$NIC" > $FILE echo "ONBOOT=yes" >> $FILE - echo "BOOTPROTO=dhcp" >> $FILE + echo "BOOTPROTO=dhcp" >> $FILE + COUNT=$(($COUNT+1)) + # We only want at max two DHCP interfaces. + if [ $COUNT -ge 1 ]; then + break; + fi done /etc/init.d/network start -- 2.39.5