aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/dhcp_probe/files/dhcp_probe.in
blob: efbf3c2d496695db9c5014fc4181d37f0dc6602b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh

# PROVIDE: dhcp_probe
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable dhcp_probe:
#
# dhcp_probe_enable="YES"
# dhcp_probe_flags="<interface>"

. /etc/rc.subr

name=dhcp_probe
desc="Attempts to discover DHCP and BootP servers on a network."
rcvar=dhcp_probe_enable

load_rc_config $name

: ${dhcp_probe_enable:="NO"}
: ${dhcp_probe_config="%%PREFIX%%/etc/dhcp_probe.cf"}

command=%%PREFIX%%/sbin/${name}

start_precmd="${name}_prestart"

dhcp_probe_prestart()
{
	# The interface (rc_flags) has to go after the config file argument
	rc_flags="-c ${dhcp_probe_config} ${rc_flags}"
	return 0
}

run_rc_command "$1"