diff options
author | 2013-01-03 11:47:33 -0600 | |
---|---|---|
committer | 2013-01-03 12:16:34 -0600 | |
commit | 048afdb1528b00ec503a977d5a818edfe91ae571 (patch) | |
tree | 4cd7d0693d6b332a228a29ee695c50e76bd0a293 | |
parent | use agetty's autologin function instead of bashlogin (diff) | |
download | livecd-tools-048afdb1528b00ec503a977d5a818edfe91ae571.tar.gz livecd-tools-048afdb1528b00ec503a977d5a818edfe91ae571.tar.bz2 livecd-tools-048afdb1528b00ec503a977d5a818edfe91ae571.zip |
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.
-rwxr-xr-x | init.d/autoconfig | 22 |
1 files 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 |