summaryrefslogtreecommitdiff
path: root/sysutils/backrest/files/backrest.in
blob: 5c709b0b2e12c145f8033562b90eed4161598ba1 (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: backrest
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Configuration settings for backrest in /etc/rc.conf
#
# backrest_enable (bool):     Enable backrest. (Default=NO)
# backrest_env_file (str):    Path containing the environment variables
#                             to be used by backrest. (Default: %%ETCDIR%%/config.env)
# backrest_logfile (str):     Log file used to store the backrest's output. (Default: /var/log/backrest.log)
# backrest_pidfile (str):     File used by backrest to store the process ID. (Default: /var/run/backrest.pid)
# backrest_runas (str):       User to run backrest as. (Default: %%USER%%)

. /etc/rc.subr

name="backrest"
desc="Web UI and orchestrator for restic backup"
rcvar="backrest_enable"

load_rc_config $name

: ${backrest_enable:="NO"}
: ${backrest_env_file:="%%ETCDIR%%/config.env"}
: ${backrest_logfile:="/var/log/backrest.log"}
: ${backrest_pidfile:="/var/run/backrest.pid"}
: ${backrest_runas:="%%USER%%"}

pidfile="${backrest_pidfile}"
procname="%%LOCALBASE%%/bin/backrest"
command="/usr/sbin/daemon"
command_args="-o '${backrest_logfile}' -p '${pidfile}' -u '${backrest_runas}' -t '${desc}' -- '${procname}'"

run_rc_command "$1"