summaryrefslogtreecommitdiff
path: root/security/stunnel/files/stunnel.in
blob: 3ab996452b19449afe52a2e169a58732f98a6d02 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: stunnel
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown

#
# Add some of the following variables to /etc/rc.conf to configure stunnel:
# stunnel_enable (bool):	Set to "NO" by default.
#				Set it to "YES" to enable stunnel.
# stunnel_config (str):		Default "!!PREFIX!!/etc/stunnel/stunnel.conf"
#				Set it to the full path to the config file
#				that stunnel will use during the automated
#				start-up.
# stunnel_pidfile (str):	Default "!!PREFIX!!/var/stunnel/stunnel.pid"
#				Set it to the value of 'pid' in
#				the stunnel.conf file.
#

. !!RC_SUBR!!

name="stunnel"
rcvar=`set_rcvar`
stunnel_config="!!PREFIX!!/etc/stunnel/${name}.conf"
stunnel_pidfile="/var/run/${name}.pid"
command="!!PREFIX!!/bin/stunnel"

[ -z "$stunnel_enable" ]		&& stunnel_enable="NO"

load_rc_config $name

command_args=${stunnel_config}
pidfile=${stunnel_pidfile}

required_files="${stunnel_config}"

run_rc_command "$1"