summaryrefslogtreecommitdiff
path: root/www/darkhttpd/files/darkhttpd.in
blob: 43b7e3d23fb0fbf34c0f9eb7e66fdb45aaa27278 (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
#!/bin/sh

# PROVIDE: darkhttpd
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Configuration settings for darkhttpd in /etc/rc.conf
#
# darkhttpd_enable (bool):    Enable darkhttpd. (default=NO)
# darkhttpd_dir (str):        WWW root directory. (default=%%WWWDIR%%)
# darkhttpd_flags (str):      Flags used for darkhttpd. (default=--uid %%USER%% --gid %%GROUP%%)
#

. /etc/rc.subr

name="darkhttpd"
rcvar="${name}_enable"

load_rc_config $name

: ${darkhttpd_enable:="NO"}
: ${darkhttpd_dir:=%%WWWDIR%%}
: ${darkhttpd_flags=--uid %%USER%% --gid %%GROUP%%}

darkhttpd_flags="${darkhttpd_dir} ${darkhttpd_flags}"

command="%%LOCALBASE%%/bin/darkhttpd"
pidfile="/var/run/darkhttpd/darkhttpd.pid"
command_args="--daemon --pidfile ${pidfile}"

run_rc_command "$1"