Changeset View
Changeset View
Standalone View
Standalone View
libexec/rc/rc.d/dhcp_client
- This file was added.
#!/bin/sh | |||||
# | |||||
# $FreeBSD$ | |||||
# | |||||
# PROVIDE: dhcp_client | |||||
# REQUIRE: mountcritlocal | |||||
# KEYWORD: nojailvnet nostart | |||||
. /etc/rc.subr | |||||
name="dhcp_client" | |||||
load_rc_config ${name} | |||||
find_client() | |||||
{ | |||||
[ -x "${dhcp_client}" ] && { | |||||
echo -n "${dhcp_client}" | |||||
return | |||||
} | |||||
for dir in /etc/rc.d ${local_startup}; do | |||||
[ -x "${dir}/${dhcp_client}" ] && { | |||||
echo -n "${dir}/${dhcp_client}" | |||||
return | |||||
} | |||||
done | |||||
} | |||||
command=$(find_client) | |||||
debug "found client program: ${command}" | |||||
if [ -n "${command}" ]; then | |||||
${command} "$@" | |||||
else | |||||
echo "ERROR: cannot find the command to start DHCP client." | |||||
exit 1 | |||||
fi |