freebsd-ports/net-mgmt/rubygem-oxidized/files/oxidized.in
Steve Wills 000f6684d5 devel/rubygem-oxidized: create port
Oxidized is a network device configuration backup tool. It's a RANCID
replacement.

WWW: https://github.com/ytti/oxidized

PR:		203374
Submitted by:	Nick Hilliard <nick@foobar.org> (with modifications)
2017-01-04 04:36:53 +00:00

61 lines
1.2 KiB
Bash

#!/bin/sh
# $FreeBSD$
#
# PROVIDE: oxidized
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Configuration settings for oxidized in /etc/rc.conf:
#
# oxidized_enable (bool):
# Set to "NO" by default.
# Set it to "YES" to enable oxidized
#
# oxidized_args (str):
# Extra arguments passed to start command
#
# oxidized_home (str)
# Set to "/var/db/oxidized" by default.
# Set the OXIDIZED_HOME variable for oxidized process
#
# oxidized_user (str):
# Set to "oxidized" by default.
# User to run oxidized as.
#
# oxidized_group (str):
# Set to "oxidized" by default.
# Group for data file ownership.
#
. /etc/rc.subr
name="oxidized"
rcvar=oxidized_enable
load_rc_config "${name}"
: ${oxidized_enable="NO"}
: ${oxidized_home="/var/db/oxidized"}
: ${oxidized_args=""}
: ${oxidized_user="oxidized"}
: ${oxidized_group="oxidized"}
piddir="/var/run/${name}"
pidfile="${piddir}/${name}.pid"
procname=%%RUBY%%
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} %%PREFIX%%/bin/oxidized ${oxidized_args}"
export HOME=${oxidized_home}
start_precmd="oxidized_prestart"
oxidized_prestart() {
if [ ! -d ${piddir} ]; then
install -d -o "${oxidized_user}" -g "${oxidized_group}" -m 750 ${piddir}
fi
}
run_rc_command "$1"