83eb2c3700
literal name_enable wherever possible, and ${name}_enable when it's not, to prepare for the demise of set_rcvar(). In cases where I had to hand-edit unusual instances also modify formatting slightly to be more uniform (and in some cases, correct). This includes adding some $FreeBSD$ tags, and most importantly moving rcvar= to right after name= so it's clear that one is derived from the other.
41 lines
821 B
Bash
41 lines
821 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: ifdepd
|
|
# REQUIRE: netif routing
|
|
# KEYWORD: shutdown
|
|
|
|
# Add the following lines to /etc/rc.conf to enable ifdepd:
|
|
#
|
|
#ifdepd_enable="YES"
|
|
#ifdepd_src_ifaces="em0:em1"
|
|
#ifdepd_dst_ifaces="carp1"
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="ifdepd"
|
|
rcvar=ifdepd_enable
|
|
|
|
command="%%PREFIX%%/bin/ifdepd"
|
|
|
|
start_cmd="ifdepd_start"
|
|
|
|
ifdepd_start()
|
|
{
|
|
echo 'Starting ifdepd.'
|
|
ifdepd_src_ifaces=`echo $ifdepd_src_ifaces | sed -E 's/[ \t]+/:/g'`
|
|
ifdepd_dst_ifaces=`echo $ifdepd_dst_ifaces | sed -E 's/[ \t]+/:/g'`
|
|
if checkyesno ${rcvar} && [ "x${ifdepd_src_ifaces}" != "x" ] &&
|
|
[ "x${ifdepd_dst_ifaces}" != "x" ]; then
|
|
$command -d -S ${ifdepd_src_ifaces} -D ${ifdepd_dst_ifaces}
|
|
else
|
|
warn '$ifdepd_ifaces is not set.'
|
|
fi
|
|
}
|
|
|
|
load_rc_config $name
|
|
|
|
ifdepd_enable=${ifdepd_enable:-"NO"}
|
|
|
|
run_rc_command "$1"
|