blob: 0d90942e1827296c90d97b90d8ccb40cdf312966 (
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
42
43
44
45
46
47
48
49
50
51
52
|
#!/bin/sh
# 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 "%%ETCDIR%%/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 "%%STUNNEL_PIDFILE%%"
# Set it to the value of 'pid' in
# the stunnel.conf file.
# stunnel_uid (str): Default "%%STUNNEL_USER%%"
# stunnel_gid (str): Default "%%STUNNEL_GROUP%%"
#
. /etc/rc.subr
name="stunnel"
rcvar=stunnel_enable
load_rc_config $name
: ${stunnel_enable="NO"}
: ${stunnel_config="%%ETCDIR%%/${name}.conf"}
: ${stunnel_pidfile="%%STUNNEL_PIDFILE%%"}
: ${stunnel_uid="%%STUNNEL_USER%%"}
: ${stunnel_gid="%%STUNNEL_GROUP%%"}
command="%%PREFIX%%/bin/stunnel"
command_args=${stunnel_config}
pidfile=${stunnel_pidfile}
required_files="${stunnel_config}"
start_precmd=stunnel_start_precmd
stunnel_start_precmd () {
local piddir
piddir=`/usr/bin/dirname "${pidfile}"`
if [ ! -d "${piddir}" ] ; then
/usr/bin/install -d -o "${stunnel_uid}" -g "${stunnel_gid}" "${piddir}"
fi
}
run_rc_command "$1"
|