#! /bin/sh # # $FreeBSD$ # # PROVIDE: dhcpd # REQUIRE: DAEMON # KEYWORD: FreeBSD # # Add the following line to /etc/rc.conf to enable dhcpd: # # dhcpd_enable="YES" # # override these variables in /etc/rc.conf dhcpd_enable=NO dhcpd_flags= # command option(s) dhcpd_conf=%%PREFIX%%/etc/dhcpd.conf # configuration file dhcpd_ifaces= # ethernet interface(s) dhcpd_precmd () { dhcpd_rcconf=%%PREFIX%%/etc/rc.isc-dhcpd.conf if [ -f ${dhcpd_rcconf} ]; then warn "${dhcpd_rcconf} is obsolete, use /etc/rc.conf instead." . ${dhcpd_rcconf} if [ -n "${dhcpd_options}" -a -z "${rc_flags}" ]; then warn "dhcpd_options is obsolete, use dhcpd_flags instead." rc_flags=${dhcpd_options} fi fi rc_flags="${rc_flags} -cf ${dhcpd_conf} ${dhcpd_ifaces}" } . %%RC_SUBR%% name=dhcpd rcvar=$(set_rcvar) command=%%PREFIX%%/sbin/${name} pidfile=/var/run/${name}.pid required_files=${dhcpd_conf} start_precmd=${name}_precmd load_rc_config ${name} run_rc_command "$1"