#! /bin/bash
#
# One word command to start up pgaccess.tcl
 
WISH=`which wish`
if [ -z "$WISH" ]
then
	echo Cannot find wish
	exit 1
fi

# postgresql.env is provided by the package postgresql-client
if [ -r /etc/postgresql/postgresql.env ]
then
	. /etc/postgresql/postgresql.env
else
	if [ -r /etc/postgresql/postmaster.conf ]
	then
		. /etc/postgresql/postmaster.conf
	fi
fi
if [ -z "$PGACCESS_HOME" ]
then
	export PGACCESS_HOME=/usr/lib/postgresql/share/pgaccess
fi
if [ -z "$PGLIB" ]
then
	export PGLIB=/usr/lib/postgresql/lib
fi

export PATH_TO_WISH=$WISH
$WISH -f ${PGACCESS_HOME}/main.tcl
