1#!/bin/sh 2 3# PROVIDE: dhcp_client 4# REQUIRE: mountcritlocal 5# KEYWORD: nojail nostart 6 7. /etc/rc.subr 8 9name="dhcp_client" 10 11load_rc_config ${name} 12dummy_rc_command "$1" 13 14find_client() 15{ 16 [ -x "${dhcp_client}" ] && { 17 echo -n "${dhcp_client}" 18 return 19 } 20 21 for dir in /etc/rc.d ${local_startup}; do 22 [ -x "${dir}/${dhcp_client}" ] && { 23 echo -n "${dir}/${dhcp_client}" 24 return 25 } 26 done 27} 28 29command=$(find_client) 30debug "found client program: ${command}" 31if [ -n "${command}" ]; then 32 ${command} "$@" 33else 34 echo "ERROR: cannot find the command to start DHCP client." 35 exit 1 36fi 37