3 # $NetBSD: dhclient,v 1.8 2002/03/22 04:33:58 thorpej Exp $
4 # $FreeBSD: src/etc/rc.d/dhclient,v 1.6 2003/06/29 05:34:41 mtm Exp $
5 # $DragonFly: src/etc/rc.d/dhclient,v 1.7 2005/11/19 21:47:32 swildner Exp $
9 # REQUIRE: netif mountcritlocal
12 # Note that there no syslog logging of dhclient messages at boot because
13 # dhclient needs to start before services that syslog depends upon do.
20 pidfile
="/var/run/${name}.pid"
22 start_precmd
="dhclient_prestart"
23 start_postcmd
="dhclient_poststart"
24 stop_cmd
="dhclient_stop"
25 stop_precmd
="dhclient_prestop"
26 stop_postcmd
="dhclient_poststop"
31 dhcp_list
="`list_net_interfaces dhcp`"
32 if [ -z "$dhcp_list" ]; then
36 # Determine the scope of the command
38 _cooked_list
="$dhcp_list"
39 if [ -n "$_cmdifn" ]; then
40 eval _cooked_list
=\"`expr "$dhcp_list" : ".*\($_cmdifn\).*"`\"
41 if [ -z "$_cooked_list" ]; then
42 err
"No such network interface: $_cmdifn"
50 dhclient_common ||
return $?
52 for ifn
in ${_cooked_list}; do
56 rc_flags
="${rc_flags} ${_cooked_list}"
62 for ifn
in ${_cooked_list}; do
71 echo -n "Releasing DHCP leases:"
72 for ifn
in $_cooked_list ; do
81 debug
"The following leases failed to release: $_fail"
86 dhclient_common ||
return $?
88 for ifn
in ${_cooked_list}; do
96 for ifn
in ${_cooked_list}; do