#!/bin/sh

# PROVIDE: datum_gateway
# REQUIRE: DAEMON NETWORKING
# BEFORE: LOGIN
# KEYWORD: shutdown

# Add the following lines to /etc/rc.conf to enable datum_gateway:
# datum_gateway_enable="YES"
#
# datum_gateway_enable (bool):	Set to YES to enable datum_gateway
#				Default: NO
# datum_gateway_user (str):	datum_gateway daemon user
#				Default: nobody
# datum_gateway_group (str):	datum_gateway daemon group
#				Default: nogroup
. /etc/rc.subr

name="datum_gateway"
rcvar=datum_gateway_enable

: ${datum_gateway_enable:="NO"}
: ${datum_gateway_user:="nobody"}
: ${datum_gateway_group:="nogroup"}

# daemon
pidfile="/var/run/${name}/${name}.pid"
command=/usr/sbin/daemon
procname="daemon"
command_args=" -c -f -P ${pidfile} %%PREFIX%%/bin/${name} -c %%PREFIX%%/etc/datum_gateway_config.json"

load_rc_config $name
run_rc_command "$1"
