#!/bin/sh

# PROVIDE: verlihub
# REQUIRE: DAEMON mysql
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# verlihub_enable (bool):   Set to NO by default.
#               Set it to YES to enable verlihub.
#

. /etc/rc.subr

name="verlihub"
rcvar=verlihub_enable

command=/usr/local/bin/${name}
pidfile=/var/run/${name}.pid

logfile=/var/log/${name}.log
errfile=/var/log/${name}.err
command_args="> $logfile 2> $errfile &"

: ${verlihub_configdir="`/usr/local/bin/vh_getcfg`"}
required_dirs="$verlihub_configdir"
required_files="$verlihub_configdir/dbconfig $verlihub_configdir/motd $verlihub_configdir/help_usr $verlihub_configdir/faq $verlihub_configdir/rules"

load_rc_config $name

: ${verlihub_enable="NO"}

start_postcmd="echo \$! > $pidfile"
stop_postcmd="rm $pidfile"

run_rc_command "$1"
