7 # KEYWORD: nojailvnet nostart
15 desc="Dynamic Host Configuration Protocol (DHCP) client"
17 pidfile="/var/run/${name}.${ifn}.pid"
18 start_precmd="dhclient_prestart"
19 stop_precmd="dhclient_pre_check"
21 # rc_force check can only be done at the run_rc_command
22 # time, so we're testing it in the pre* hooks.
25 if [ -z "${rc_force}" ] && ! dhcpif $ifn; then
27 msg="'$ifn' is not a DHCP-enabled interface"
28 if [ -z "${rc_quiet}" ]; then
41 # Interface-specific flags (see rc.subr for $flags setting)
42 specific=$(get_if_var $ifn dhclient_flags_IF)
43 if [ -z "$flags" -a -n "$specific" ]; then
47 background_dhclient=$(get_if_var $ifn background_dhclient_IF $background_dhclient)
48 if checkyesno background_dhclient; then
49 rc_flags="${rc_flags} -b"
52 rc_flags="${rc_flags} ${ifn}"
56 load_rc_config network
59 # only complain if a command was specified but no interface
61 err 1 "$0: no interface specified"