version 1.1, 2009/04/28 23:30:34 |
version 1.4, 2015/10/16 18:06:22 |
Line 9 $_rc_subr_loaded . /etc/rc.subr |
|
Line 9 $_rc_subr_loaded . /etc/rc.subr |
|
name=dhcpcd |
name=dhcpcd |
rcvar=$name |
rcvar=$name |
command=/sbin/$name |
command=/sbin/$name |
pidfile=/var/run/$name.pid |
extra_commands="reload" |
|
|
load_rc_config $name |
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##* }" |
|
# Address the problem of having just dhcpcd_flags=wm0 |
|
if [ "$myflags" = "$last_flag" ]; then |
|
last_flag="invalidinterfacename" |
|
fi |
|
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" |
run_rc_command "$1" |