summaryrefslogtreecommitdiff
path: root/www/rustypaste/files/rustypaste.in
blob: 19f3b724af122e11825bea5b83f1c99bb5a7bc00 (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
#!/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"