#!/bin/sh
#
# $Id$
#

# PROVIDE: cmglobal
# REQUIRE: DAEMON
# KEYWORD: shutdown

#
# Add the following line to /etc/rc.conf
# or to /etc/rc.conf.d/cmglobal to enable cmglobal:
#
# cmglobal_enable="YES"
#

. /etc/rc.subr

name="cmglobal"
rcvar=${name}_enable

load_rc_config $name

: ${cmglobal_enable="YES"}
: ${cmglobal_user="mspam"}
: ${cmglobal_data="/Berkanavt/clustermaster"}

: ${cmglobal_viewer_port="3332"}
: ${cmglobal_worker_port="3331"}

: ${cmglobal_pid="${cmglobal_data}/run/${name}.pid"}

: ${cmglobal_flags="-v ${cmglobal_data}/var.global \
		-C tempworkaround \
                -a ${cmglobal_data}/keys/auth.secret \
                -h ${cmglobal_viewer_port} \
                -w ${cmglobal_worker_port} \
		-P ${cmglobal_pid} \
		-g \
		"}

command="${cmglobal_data}/bin/worker"
command_args="${cmglobal_flags}"

required_files="${command}"

load_rc_config $name
run_rc_command "$1"
