#!/bin/sh
#
# $FreeBSD: ports/databases/pgcluster/files/pglb.in,v 1.2 2007/07/26 16:05:04 rafan Exp $
#
# PROVIDE: pglb
# REQUIRE: DAEMON
#
# Add the following line to /etc/rc.conf to enable pglb:
#
# pglb_enable="YES"
#

. /etc/rc.subr

name="pglb"
rcvar=`set_rcvar`

command=/usr/local/bin/${name}

load_rc_config $name

: ${pglb_enable="NO"}
: ${pglb_data="/usr/local/pgsql/data"}

pglb_user=pgsql
pglb_flags="${pglb_flags} -D ${pglb_data}"

stop_cmd="pglb_stop"

pglb_stop()
{
    su -m ${pglb_user} -c "exec ${command} -D ${pglb_data} stop"
}

run_rc_command "$1"
