#!/bin/ash
# *********************************************************************
# nosql: user interface compatibility wrapper.
#
# Copyright (c) 1998,2009 Carlo Strozzi
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 dated June, 1991.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# *********************************************************************

# Get local settings and apply defaults. Looking for the optional
# configuration file is done only in this shell script, so it will
# be taken into account only if NoSQL is invoked according to the old
# version 2 syntax "nosql <command>". This is intentional and it was
# done mainly to satisfy the file-system standards of common Linux
# distros without having to put every NoSQL executable in /usr/bin/ .

: ${NOSQL:=@NOSQL_INSTALL@/etc/nosql.rc}

[ -e "$NOSQL" ] && . "$NOSQL"

: ${NOSQL_INSTALL:=@NOSQL_INSTALL@/etc/nosql.rc}

: ${SWU_INSTALL:=@SWU_INSTALL@} ${TMPDIR:=/tmp} ${NOSQL_CHARSET:=utf-8}

: ${PATH:=@LOCAL_PATH@}

export NOSQL NOSQL_INSTALL SWU_INSTALL PATH TMPDIR NOSQL_CHARSET

# Exit immediately if no arguments were supplied.
[ $# -eq 0 ] && exit 1

# Run the version-sepcific wrapper back-end.
. $NOSQL_INSTALL/lib/nosql.sh

exit $?

# End of program.
