diff options
author | mtm <mtm@FreeBSD.org> | 2003-04-18 17:53:02 +0000 |
---|---|---|
committer | mtm <mtm@FreeBSD.org> | 2003-04-18 17:53:02 +0000 |
commit | 0c05e7432662674255e1c1925f4ed53a8ae4e017 (patch) | |
tree | 54fb2833074d059d8ee20689f8a84818e2bd1364 /etc | |
parent | 70cccaca8387a83c2d2dc478226f5764a07652c9 (diff) | |
download | FreeBSD-src-0c05e7432662674255e1c1925f4ed53a8ae4e017.zip FreeBSD-src-0c05e7432662674255e1c1925f4ed53a8ae4e017.tar.gz |
Make use of the dhclient script. This will bring up/down dhcp
interfaces.
Approved by: markm (mentor)
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/rc.d/dhclient | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/etc/rc.d/dhclient b/etc/rc.d/dhclient index cbdc8b0..8b1015a 100755 --- a/etc/rc.d/dhclient +++ b/etc/rc.d/dhclient @@ -5,19 +5,49 @@ # # PROVIDE: dhclient -# REQUIRE: network mountcritlocal +# REQUIRE: network netif mountcritlocal # BEFORE: NETWORKING +# KEYWORD: FreeBSD NetBSD # # Note that there no syslog logging of dhclient messages at boot because # dhclient needs to start before services that syslog depends upon do. # . /etc/rc.subr +. /etc/network.subr name="dhclient" -rcvar=$name command="/sbin/${name}" pidfile="/var/run/${name}.pid" +case "${OSTYPE}" in +FreeBSD) + rcvar= + start_precmd="dhclient_prestart" + start_postcmd="dhclient_poststart" + ;; +NetBSD) + rcvar=$name + ;; +esac + +dhclient_prestart() +{ + dhcp_list="`list_net_interfaces dhcp`" + if [ -z "$dhcp_list" ]; then + return 1 + fi + rc_flags="${rc_flags} ${dhcp_flags} ${dhcp_list}" + return 0 +} + +dhclient_poststart() +{ + for ifn in ${dhcp_list}; do + ifalias_up ${ifn} + ipx_up ${ifn} + ifconfig ${ifn} + done +} load_rc_config $name run_rc_command "$1" |