[PC-BSD Commits] r195 - in pcbsd/trunk: installcd-overlay/usr/local/pcbsd/scripts system-overlay/etc

svn at pcbsd.org svn at pcbsd.org
Tue Apr 24 16:29:35 PDT 2007


Author: kris
Date: 2007-04-25 00:29:35 +0100 (Wed, 25 Apr 2007)
New Revision: 195

Modified:
   pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.NetConfig.sh
   pcbsd/trunk/system-overlay/etc/rc.conf
Log:
Updates to rc.conf and the install CD network configuration, sets up NICs as DHCP if the user didn't specify any IP. Also removes the rc.conf loop which tries to auto set everything to DHCP

Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.NetConfig.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.NetConfig.sh	2007-04-24 19:40:50 UTC (rev 194)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.NetConfig.sh	2007-04-24 23:29:35 UTC (rev 195)
@@ -41,3 +41,25 @@
 cat /mnt/etc/rc.conf | grep -v "hostname=" > /tmp/rc.tmp
 mv /tmp/rc.tmp /mnt/etc/rc.conf
 echo "hostname=\"${HOST}\"" >> /mnt/etc/rc.conf
+
+# Now Setup the DHCP for each card
+config="`ifconfig -l`"
+
+NIC="de em ixgb txp vx bfe bge dc fxp lge nge pcn re rl sf sis sk ste ti tl tx vge vr wb xl cs ed ex ep fe ie lnc sn xe an awi wi nve"
+
+for i in $NIC; do
+
+    echo "${config}" | grep "${i}0"  >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
+      echo "ifconfig_${i}0=\"DHCP\"" >> /mnt/etc/rc.conf
+    fi
+    
+    echo "${config}" | grep "${i}1"  >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
+      echo "ifconfig_${i}1=\"DHCP\"" >> /mnt/etc/rc.conf
+    fi
+
+done
+

Modified: pcbsd/trunk/system-overlay/etc/rc.conf
===================================================================
--- pcbsd/trunk/system-overlay/etc/rc.conf	2007-04-24 19:40:50 UTC (rev 194)
+++ pcbsd/trunk/system-overlay/etc/rc.conf	2007-04-24 23:29:35 UTC (rev 195)
@@ -1,14 +1,6 @@
 background_dhclient="YES" 
 hostname="PCBSD.localhost" 
 compat5x_enable="YES" 
- 
-NIC="de em ixgb txp vx bfe bge dc fxp lge nge pcn re rl sf sis sk ste ti tl tx vge vr wb xl cs ed ex ep fe ie lnc sn xe an awi wi nve" 
- 
-for i in $NIC; do 
-      eval ifconfig_${i}0="DHCP" 
-      eval ifconfig_${i}1="DHCP" 
-done 
- 
 blanktime="180" 
 saver="logo" 
 sshd_enable="YES" 



More information about the Commits mailing list