mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-05 01:55:52 +00:00
20b17ff3de
- New USE_RC_SUBR order - Stop daemons on ports deinstall. (Add note in UPDATING about this) PR: ports/102489 Submitted by: maintainer
58 lines
1.2 KiB
Bash
58 lines
1.2 KiB
Bash
#! /bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: dhcrelay
|
|
# REQUIRE: DAEMON
|
|
#
|
|
# Add the following line to /etc/rc.conf to enable dhcrelay:
|
|
#
|
|
# dhcrelay_enable="YES"
|
|
#
|
|
|
|
# override these variables in /etc/rc.conf
|
|
dhcrelay_enable=${dhcrelay_enable:-"NO"}
|
|
dhcrelay_flags=${dhcrelay_flags:-} # command option(s)
|
|
dhcrelay_servers=${dhcrelay_servers:-} # dhcrelay server(s)
|
|
dhcrelay_ifaces=${dhcrelay_ifaces:-} # ethernet interface(s)
|
|
|
|
dhcrelay_precmd ()
|
|
{
|
|
local ifaces
|
|
|
|
dhcrelay_rcconf=%%PREFIX%%/etc/rc.isc-dhcrelay.conf
|
|
|
|
if [ -f ${dhcrelay_rcconf} ]; then
|
|
warn "${dhcrelay_rcconf} is obsolete, use /etc/rc.conf instead."
|
|
. ${dhcrelay_rcconf}
|
|
|
|
if [ -n "${dhcrelay_options}" -a -z "${rc_flags}" ]; then
|
|
warn "dhcrelay_options is obsolete, use dhcrelay_flags instead."
|
|
rc_flags=${dhcrelay_options}
|
|
fi
|
|
fi
|
|
|
|
if [ -z "${dhcrelay_servers}" ]; then
|
|
err 1 "no dhcrelay server(s) configured."
|
|
fi
|
|
|
|
ifaces=
|
|
for iface in ${dhcrelay_ifaces}; do
|
|
ifaces="${ifaces} -i ${iface}"
|
|
done
|
|
|
|
rc_flags="${rc_flags} ${ifaces} ${dhcrelay_servers}"
|
|
}
|
|
|
|
. %%RC_SUBR%%
|
|
|
|
name=dhcrelay
|
|
rcvar=${name}_enable
|
|
|
|
command=%%PREFIX%%/sbin/${name}
|
|
pidfile=/var/run/${name}.pid
|
|
start_precmd=${name}_precmd
|
|
|
|
load_rc_config ${name}
|
|
run_rc_command "$1"
|