ports/www/darkhttpd/files/darkhttpd.in
Jesús Daniel Colmenares Oviedo 9884951c50 www/darkhttpd: add rc script
PR:		266239
Reported by:	DtxdF@disroot.org
Approved by:	henrichartzer@tuta.io (maintainer, timeout > 1 month)
2022-10-06 18:05:41 +02:00

31 lines
753 B
Bash

#!/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"