dhcpcd revision 1.3
11.1Sroy#!/bin/sh
21.1Sroy
31.1Sroy# PROVIDE: dhcpcd
41.1Sroy# REQUIRE: network mountcritlocal
51.1Sroy# BEFORE:  NETWORKING
61.1Sroy
71.1Sroy$_rc_subr_loaded . /etc/rc.subr
81.1Sroy
91.1Sroyname=dhcpcd
101.1Sroyrcvar=$name
111.1Sroycommand=/sbin/$name
121.3Skhorbenextra_commands="reload"
131.1Sroy
141.1Sroyload_rc_config $name
151.2Sroy
161.2Sroy# If the last argument to dhcpcd is a valid interface and the prior argument
171.2Sroy# is not then dhcpcd will start on one interface only and create a pidfile
181.2Sroy# based on the interface name. See PR bin/43490.
191.2Sroyif [ -n "$flags" ]; then
201.2Sroy	myflags=$flags
211.2Sroyelse
221.2Sroy	eval myflags=\$${name}_flags
231.2Sroyfi
241.2Sroyifname="${myflags##* }"
251.2Sroymyflags="${myflags%% $ifname}"
261.2Sroylast_flag="${myflags##* }"
271.2Sroyif /sbin/ifconfig "$ifname" >/dev/null 2>&1 && 
281.2Sroy    ! /sbin/ifconfig "$last_flag" >/dev/null 2>&1
291.2Sroythen
301.2Sroy	pidfile=/var/run/$name-"$ifname".pid
311.2Sroyelse
321.2Sroy	pidfile=/var/run/$name.pid
331.2Sroyfi
341.2Sroyunset myflags ifname last_flag
351.2Sroy
361.1Sroyrun_rc_command "$1"
37