diff options
author | Judd Vinet <judd@archlinux.org> | 2002-04-27 21:04:15 +0000 |
---|---|---|
committer | Judd Vinet <judd@archlinux.org> | 2002-04-27 21:04:15 +0000 |
commit | efa9a6d681b87fa4b8e321173690144b17a08d35 (patch) | |
tree | 648ec4fecfdf2612cdfb3f1a1c227c6a87482ee6 | |
parent | 30277f5e1ce30a10ed08ae2529282718c86ac826 (diff) |
Added DHCP handling to initscripts
-rwxr-xr-x | network | 14 | ||||
-rw-r--r-- | rc.conf | 5 |
2 files changed, 16 insertions, 3 deletions
@@ -11,7 +11,11 @@ case "$1" in if echo $ifline | grep '^[^\!]' 2>&1 > /dev/null; then varname="\$${ifline}" eval new_ifline=$varname - /sbin/ifconfig $new_ifline || stat_die + if [ "$new_ifline" = "dhcp" ]; then + /usr/sbin/dhcpcd $ifline || stat_die + else + /sbin/ifconfig $new_ifline || stat_die + fi fi done for rtline in "${ROUTES[@]}"; do @@ -36,9 +40,15 @@ case "$1" in if echo $ifline | grep '^[^\!]' 2>&1 > /dev/null; then varname="\$${ifline}" eval new_ifline=$varname - /sbin/ifconfig $new_ifline down || stat_die + if [ "$new_ifline" = "dhcp" ]; then + # do nothing - we kill dhcpcd later + /bin/true + else + /sbin/ifconfig $new_ifline down || stat_die + fi fi done + /usr/bin/killall -q dhcpcd stat_done ;; restart) @@ -14,10 +14,13 @@ TIMEZONE=Canada/Pacific HOSTNAME="myhost" # +# # Interfaces to start at boot-up (in this order) # Declare each interface then list in INTERFACES # (prefix an interface in INTERFACES with a ! to disable it) # +# Note: to use DHCP, set your interface to be "dhcp" (eth0="dhcp") +# lo="lo 127.0.0.1" eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" INTERFACES=(lo eth0) @@ -28,7 +31,7 @@ INTERFACES=(lo eth0) # (prefix a route in ROUTES with a ! to disable it) # gateway="default gw 192.168.0.1" -ROUTES=(gateway) +ROUTES=(!gateway) # # Daemons to start at boot-up (in this order) |