summaryrefslogtreecommitdiff
path: root/security/doorman/files/doorman.sh.in
blob: 883c83f5779f04ea6bce7b48ca47892e73b2815f (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
#!/bin/sh
#

# PROVIDE: doorman
# REQUIRE: LOGIN
# KEYWORD: FreeBSD

#
# Add the following lines to /etc/rc.conf to enable doorman:
# doorman_enable (bool):      Set to "NO" by default.
#                             Set it to "YES" to enable doorman
# doorman_config (path):      Set to "%%PREFIX%%/etc/doormand/doormand.cf" by default.
#

. %%RC_SUBR%%

name="doorman"
rcvar=`set_rcvar`

[ -z "$doorman_enable" ] && doorman_enable="NO"
[ -z "$doorman_config" ] && doorman_config="%%PREFIX%%/etc/doormand/doormand.cf"

[ -f "$doorman_config" ] || (echo "$doorman_config" does not exist.; exit)

command=%%PREFIX%%/sbin/doormand
pidfile=/var/run/doormand.pid
command_args="-p $pidfile -f $doorman_config"

load_rc_config $name
run_rc_command "$1"