#!/bin/sh

# PROVIDE: foreman-proxy
# BEFORE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable foreman-proxy:
# foreman_proxy_enable (bool):    Set to "NO" by default
#                                 Set it to "YES" to enable nsca.
. /etc/rc.subr

name="foreman_proxy"
rcvar="foreman_proxy_enable"

command="/usr/local/sbin/smart-proxy"
command_interpreter="/usr/local/bin/ruby30"
pidfile="/var/run/foreman-proxy/foreman-proxy.pid"

foreman_proxy_enable=${foreman_proxy_enable:-"NO"}
foreman_proxy_user=${foreman_proxy_user-"foreman_proxy"}

load_rc_config "${name}"

required_files="/usr/local/etc/foreman-proxy/settings.yml"

run_rc_command "$1"
