WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Advices: /etc/init.d/dhcp.sh  (Read 2144 times)

Offline carbonjiao

  • WikiUser
  • *
  • Posts: 3
Advices: /etc/init.d/dhcp.sh
« on: August 01, 2009, 03:45:49 AM »
I use wireless in Tinycore, while dont wanna to install wireless_tools, KISS...

I changed the line of /etc/init.d/dhcp.sh as below, and does it works!

Just for your reference.

#!/bin/sh
# The DHCP portion is now separated out, in order to not slow the boot down
# only to wait for slow network cards
. /etc/init.d/tc-functions

# This waits until all devices have registered
/sbin/udevsettle

#NETDEVICES="$(awk -F: '/eth.:|tr.:/{print $1}' /proc/net/dev 2>/dev/null)"   get the interface, really waste of time
for DEVICE in eth[0-9] wlan[0-9] ath[0-9]; do
  echo  "${GREEN}Network device ${MAGENTA}$DEVICE${GREEN} detected, DHCP broadcasting for IP.${NORMAL}"
  trap 2 3 11
  /sbin/udhcpc -b -i $DEVICE -h $(/bin/hostname) -p /var/run/udhcpc.$DEVICE.pid >/dev/null 2>&1 &
  trap "" 2 3 11
  sleep 1
done