#!/bin/sh
#
# $FreeBSD: ports/databases/pgcluster/files/pglb.sh.tmpl,v 1.4 2006/02/20 20:46:51 dougb Exp $
#
# PROVIDE: pglb
# REQUIRE: DAEMON
#
# Add the following line to /etc/rc.conf to enable pglb:
#
# pglb_enable="YES"
#

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

. /etc/rc.subr

load_rc_config pglb

name=pglb
rcvar=`set_rcvar`
command=/usr/local/bin/pglb
pglb_user=pgsql
stop_cmd="pglb_stop"

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

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

load_rc_config $name
run_rc_command "$1"
