summaryrefslogtreecommitdiff
path: root/etc/rc.d/dhcpcd
blob: 595e8c10af9af839311add8e330e9696851cf366 (plain)
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
#!/bin/sh

# $NetBSD: dhcpcd,v 1.11 2020/09/08 12:52:18 martin Exp $

# PROVIDE: dhcpcd
# REQUIRE: network CRITLOCALMOUNTED
# BEFORE:  NETWORKING

$_rc_subr_loaded . /etc/rc.subr

name=dhcpcd
rcvar=$name
command=/sbin/$name
extra_commands="reload"

load_rc_config $name

# Work out what pidfile dhcpcd will use based on flags
if [ -n "$flags" ]; then
	myflags=$flags
else
	eval myflags=\$${name}_flags
fi
pidfile=$(eval $command -P $myflags 2>/dev/null)
: ${pidfile:=/var/run/$name.pid}
unset myflags

run_rc_command "$1"