1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-24 00:45:52 +00:00
freebsd-ports/security/tinc/files/tincd.in
Dirk Meyer 2e5654f50a - fix comment
PR:		171006
Submitted by:	Nick Hibma
2012-08-27 05:06:01 +00:00

83 lines
1.3 KiB
Bash

#!/bin/sh
# $FreeBSD$
#
# PROVIDE: tincd
# REQUIRE: ipfilter FILESYSTEMS sysctl netif
# BEFORE: SERVERS routing
# KEYWORD: nojail
#
# Define these tincd_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
# /etc/rc.conf.d/tincd
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
tincd_enable=${tincd_enable:-"NO"}
. /etc/rc.subr
name="tincd"
rcvar="tincd_enable"
command="%%PREFIX%%/sbin/tincd"
start_cmd="tincd_start"
stop_cmd="tincd_stop"
reload_cmd="tincd_reload"
extra_commands="reload"
procname=${command:-tincd}
load_rc_config $name
tincd_start()
{
if test -z "${tincd_cfg}"
then
echo "Starting tincd"
$command
else
for cfg in ${tincd_cfg}
do
echo "Starting tincd for: ${cfg}"
$command -n $cfg
done
fi
# code deliberately borrowed from /etc/rc.d/netif
if [ -f /etc/rc.d/ipfilter ] ; then
# Resync ipfilter
/etc/rc.d/ipfilter quietresync
fi
}
tincd_stop()
{
if test -z "${tincd_cfg}"
then
echo "Stopping tincd"
$command -k
else
echo "Stopping tincd for: "
for cfg in $tincd_cfg
do
echo "Stopping tincd for: ${cfg}"
$command -n $cfg -k
done
fi
}
tincd_reload()
{
if test -z "${tincd_cfg}"
then
echo "Sending HUP to tincd"
$command --kill=HUP
else
for cfg in $tincd_cfg
do
echo "Sending HUP to tincd for: ${cfg}"
$command -n $cfg --kill=HUP
done
fi
}
run_rc_command "$1"
# eof