blob: 67385bb9e7c703b723141b94ab20d3cf811276ea (
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
29
30
31
32
33
34
35
36
|
#!/bin/sh
# PROVIDE: dhcpcd
# REQUIRE: network mountcritlocal
# BEFORE: NETWORKING
$_rc_subr_loaded . /etc/rc.subr
name=dhcpcd
rcvar=$name
command=/sbin/$name
extra_commands="reload"
load_rc_config $name
# If the last argument to dhcpcd is a valid interface and the prior argument
# is not then dhcpcd will start on one interface only and create a pidfile
# based on the interface name. See PR bin/43490.
if [ -n "$flags" ]; then
myflags=$flags
else
eval myflags=\$${name}_flags
fi
ifname="${myflags##* }"
myflags="${myflags%% $ifname}"
last_flag="${myflags##* }"
if /sbin/ifconfig "$ifname" >/dev/null 2>&1 &&
! /sbin/ifconfig "$last_flag" >/dev/null 2>&1
then
pidfile=/var/run/$name-"$ifname".pid
else
pidfile=/var/run/$name.pid
fi
unset myflags ifname last_flag
run_rc_command "$1"
|