ports-local/www/rustypaste-pretty/files/rustypaste.in
2023-03-01 00:05:09 -05:00

36 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
# PROVIDE: rustypaste
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Configuration settings for rustypaste in /etc/rc.conf
#
# rustypaste_enable (bool): Enable rustypaste. (Default=NO)
# rustypaste_env_file (str): Path containing the environment variables
# to be used by rustypaste. (Default: %%ETCDIR%%/rustypaste.env)
# rustypaste_logfile (str): Log file used to store the rustypaste's output. (Default: /var/log/rustypaste.log)
# rustypaste_pidfile (str): File used by rustypaste to store the process ID. (Default: /var/run/rustypaste.pid)
# rustypaste_username (str): User to run rustypaste as. (Default: rustypaste)
. /etc/rc.subr
name="rustypaste"
desc="Minimal file upload/pastebin service"
rcvar="rustypaste_enable"
load_rc_config $name
: ${rustypaste_enable:="NO"}
: ${rustypaste_env_file:="%%ETCDIR%%/rustypaste.env"}
: ${rustypaste_logfile:="/var/log/rustypaste.log"}
: ${rustypaste_pidfile:="/var/run/rustypaste.pid"}
: ${rustypaste_username:="%%USER%%"}
pidfile="${rustypaste_pidfile}"
procname="%%PREFIX%%/bin/rustypaste"
command="/usr/sbin/daemon"
command_args="-o '${rustypaste_logfile}' -p '${pidfile}' -u '${rustypaste_username}' -t '${desc}' -- ${procname}"
run_rc_command "$1"