#!/bin/sh
#
# gwsetup:       Starts the genealogy Server 
# description: Starts and stops the genealogy adminstration Service
#

GWLANG=$(/sbin/e-smith/db configuration getprop sysconfig Language | sed -e 's/_.*$//')
BD=$(/sbin/e-smith/db configuration getprop geneweb DBDir || echo "/opt/geneweb/bases")
TcpPort=$(/sbin/e-smith/db configuration getprop gwsetup TcpPort)

HD="/opt/geneweb/gw/gw"
BIN=$HD/gwsetup

start() {
	echo -n "Starting gwsetup Services (gwsetup):"
	$BIN -daemon -gd $HD -bindir $HD -p $TcpPort -lang $GWLANG
}

cd $BD

case "$1" in
	start)
	    $1
	    ;;
	*)
	    echo "*** Usage: gwsetup {start}"
	    exit 1
esac

exit 0
