ports/net/dhcpcd/files/dhcpcd.in
Steve Wills 68b290903b net/dhcpcd: remove nostart keyword from rc script
PR:		213018
Submitted by:	roy@marples.name (maintainer)
2017-11-09 22:17:48 +00:00

40 lines
666 B
Bash

#!/bin/sh
# PROVIDE: dhclient
# KEYWORD: nojail
#
. /etc/rc.subr
. /etc/network.subr
name="dhcpcd"
ifn="$2"
command="%%PREFIX%%/sbin/dhcpcd"
command_args="$ifn"
if [ -n "$ifn" ]; then
specific="$(get_if_var $ifn dhcpcd_flags_IF)"
if [ -z "$flags" -a -n "$specific" ]; then
rc_flags="$specific"
fi
pidfile="/var/run/dhcpcd-$ifn.pid"
else
pidfile="$($command -P $rc_flags)"
fi
start_precmd="dhcpcd_precmd"
dhcpcd_precmd()
{
# dhcpcd may need local binaries
export PATH=${PATH}:/usr/local/sbin
}
load_rc_config $name
load_rc_config network
if [ -n "$ifn" ]; then
if ! dhcpif $ifn; then
err 1 "$ifn is not enabled for DHCP"
fi
fi
run_rc_command "$1"