aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2002-04-27 21:04:15 +0000
committerJudd Vinet <judd@archlinux.org>2002-04-27 21:04:15 +0000
commitefa9a6d681b87fa4b8e321173690144b17a08d35 (patch)
tree648ec4fecfdf2612cdfb3f1a1c227c6a87482ee6
parent30277f5e1ce30a10ed08ae2529282718c86ac826 (diff)
downloadinitscripts-efa9a6d681b87fa4b8e321173690144b17a08d35.tar.xz
Added DHCP handling to initscripts
-rwxr-xr-xnetwork14
-rw-r--r--rc.conf5
2 files changed, 16 insertions, 3 deletions
diff --git a/network b/network
index c316e70..20f9f76 100755
--- a/network
+++ b/network
@@ -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)
diff --git a/rc.conf b/rc.conf
index 6e73d4c..367101f 100644
--- a/rc.conf
+++ b/rc.conf
@@ -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)