#
# $Id: functions 2937 2012-05-30 18:17:09Z rdempsey $
#

if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
	test -f /etc/default/columnstore && . /etc/default/columnstore
fi

if [ -z "$COLUMNSTORE_INSTALL_DIR" ]; then
	COLUMNSTORE_INSTALL_DIR=/usr/local/mariadb/columnstore
fi

export COLUMNSTORE_INSTALL_DIR=$COLUMNSTORE_INSTALL_DIR

PATH=$COLUMNSTORE_INSTALL_DIR/bin:$PATH
export PATH

module_type()
{
(
	sed -r 's/[0-9]+$//' $COLUMNSTORE_INSTALL_DIR/local/module
) 2>/dev/null
}

firstboot()
{
	dbrmroot="`getConfig SystemConfig DBRMRoot`"
	dbrmdir="`dirname $dbrmroot`"
	test ! -f $dbrmdir/BRM_saves_current
}

oidbitmapfile()
{
	oidfile="`getConfig OIDManager OIDBitmapFile`"
	test ! -f $oidfile
}

module_name()
{
(
	cat $COLUMNSTORE_INSTALL_DIR/local/module
) 2>/dev/null
}

module_id()
{
(
	sed -r 's/[a-zA-Z]//g' $COLUMNSTORE_INSTALL_DIR/local/module
) 2>/dev/null
}
