Added
Link Here
|
1 |
#!/bin/sh |
2 |
# |
3 |
|
4 |
# PROVIDE: ifdepd |
5 |
# REQUIRE: netif routing |
6 |
# KEYWORD: FreeBSD shutdown |
7 |
|
8 |
# |
9 |
# Add the following lines to /etc/rc.conf to enable ifdepd: |
10 |
# |
11 |
#ifdepd_enable="YES" |
12 |
#ifdepd_src_ifaces="em0:em1" |
13 |
#ifdepd_dst_ifaces="carp1" |
14 |
|
15 |
. /etc/rc.subr |
16 |
|
17 |
name="ifdepd" |
18 |
rcvar=`set_rcvar` |
19 |
command="/usr/local/bin/ifdepd" |
20 |
start_cmd="ifdepd_start" |
21 |
stop_cmd="ifdepd_stop" |
22 |
|
23 |
ifdepd_enable=${ifdepd_enable:-"NO"} |
24 |
load_rc_config $name |
25 |
|
26 |
ifdepd_start() |
27 |
{ |
28 |
echo 'Starting ifdepd.' |
29 |
ifdepd_src_ifaces=`echo $ifdepd_src_ifaces | sed -E 's/[ \t]+/:/g'` |
30 |
ifdepd_dst_ifaces=`echo $ifdepd_dst_ifaces | sed -E 's/[ \t]+/:/g'` |
31 |
if checkyesno ${rcvar} && [ "x${ifdepd_src_ifaces}" != "x" ] && |
32 |
[ "x${ifdepd_dst_ifaces}" != "x" ]; then |
33 |
$command -d -S ${ifdepd_src_ifaces} -D ${ifdepd_dst_ifaces} |
34 |
else |
35 |
warn '$ifdepd_ifaces is not set.' |
36 |
fi |
37 |
} |
38 |
|
39 |
ifdepd_stop() |
40 |
{ |
41 |
echo 'Stopping ifdepd.' |
42 |
killall ifdepd |
43 |
} |
44 |
|
45 |
run_rc_command "$1" |