From 048afdb1528b00ec503a977d5a818edfe91ae571 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Thu, 3 Jan 2013 11:47:33 -0600 Subject: autoconfig: run one instance of dhcpcd One instance of dhcpcd in standalone mode can control all detected interfaces. This should automatically get an address for any network where there is an active dhcp server. This will also fix bug #439912. --- init.d/autoconfig | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/init.d/autoconfig b/init.d/autoconfig index 7511366..8f5c5db 100755 --- a/init.d/autoconfig +++ b/init.d/autoconfig @@ -508,22 +508,16 @@ start() { if [ -n "${NETDEVICES}" ] then - for nics in ${NETDEVICES} - do - if yesno "${DHCP}" + if yesno "${DHCP}" + then + einfo "DHCP broadcasting for IP on all detected interfaces ..." + if [ -f /var/run/dhcpcd.pid ] then - einfo "Network device ${HILITE}${nics}${NORMAL} detected, DHCP broadcasting for IP ..." - if [ -f /var/run/dhcpcd-${nics}.pid ] - then - if [ -z "$(/sbin/ifconfig ${nics} | grep 'inet addr')" ] - then - kill $(cat /var/run/dhcpcd-${nics}.pid) - sleep 2 - dhcpcd -n -h $(hostname) ${nics} - fi - fi + kill $(cat /var/run/dhcpcd.pid) + sleep 2 fi - done + dhcpcd -n -h $(hostname) + fi if ! yesno "${PASSWD}" then echo "root:${PASSWORD}" | chpasswd > /dev/null 2>&1 -- cgit v1.2.3-65-gdbad