#!/bin/bash

set -e

DIR=`dirname $0`
if [ -f $DIR/functions ]; then
    . $DIR/functions
else
    if [ -f /usr/share/flexibee/bin/functions ]; then
	. /usr/share/flexibee/bin/functions
    fi
fi


# Detect PostgreSQL and sets $RUNNING if PostgreSQL is Running.
WinStrom_detectPostgresql
WinStrom_detectPostgresqlRunning
WinStrom_startIfNeeded $RUNNING

/etc/init.d/flexibee start || exit 1

exit 0
