freebsd-ports/sysutils/bareos22-server/files/bareos-sd.in
Jose Alonso Cardenas Marquez e86aedbcb0
sysutils/bareos22-*: Copy bareos-* ports to bareso22-* ones
- bareos-* ports will be updated to 23.0.1 soon
2024-01-19 18:41:04 -05:00

37 lines
937 B
Bash

#!/bin/sh
# PROVIDE: bareos_sd
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# bareos_sd_enable (bool): Set to NO by default.
# Set it to YES to enable bareos_sd.
# bareos_sd_flags (params): Set params used to start bareos_sd.
# bareos_sd_config (params): Path to the config file/directory
#
. /etc/rc.subr
name="bareos_sd"
rcvar=${name}_enable
load_rc_config $name
: ${bareos_sd_enable="NO"}
: ${bareos_sd_flags="-u bareos -g bareos -v"}
: ${bareos_sd_config="%%PREFIX%%/etc/bareos/"}
: ${bareos_sd_pidfile="/var/run/bareos/bareos-sd.9103.pid"}
command=%%PREFIX%%/sbin/bareos-sd
command_args="-c ${bareos_sd_config} -p ${bareos_sd_pidfile}"
pidfile="${bareos_sd_pidfile}"
start_precmd="bareos_start_precmd"
bareos_start_precmd() {
[ -d "${pidfile%/*}" ] || install -d -o bareos -g bareos ${pidfile%/*}
}
run_rc_command "$1"