-fix some vars

This commit is contained in:
Özgür Kesim 2022-10-04 11:34:46 +02:00
parent 3ec07d62c3
commit 3fdf88f612
Signed by: oec
GPG Key ID: 3D76A56D79EDD9D7
3 changed files with 4 additions and 4 deletions

View File

@ -102,7 +102,7 @@ function cleanup()
function exit_cleanup() function exit_cleanup()
{ {
echo "Running exit-cleanup" echo "Running exit-cleanup"
if test ! -z ${POSTGRES_PATH:-} if ! [[ -z ${POSTGRES_PATH:-} ]]
then then
echo "Stopping Postgres at ${POSTGRES_PATH}" echo "Stopping Postgres at ${POSTGRES_PATH}"
${POSTGRES_PATH}/pg_ctl -D $TMPDIR -l /dev/null stop &> /dev/null || true ${POSTGRES_PATH}/pg_ctl -D $TMPDIR -l /dev/null stop &> /dev/null || true
@ -2050,7 +2050,7 @@ INITDB_BIN=$(command -v initdb) || true
if [[ ! -z $INITDB_BIN ]]; then if [[ ! -z $INITDB_BIN ]]; then
echo " FOUND (in path) at" $INITDB_BIN echo " FOUND (in path) at" $INITDB_BIN
else else
HAVE_INITDB=`find /usr -name "initdb" 2> /dev/null | grep postgres` || exit_skip " MISSING" HAVE_INITDB=`find /usr -name "initdb" 2> /dev/null | grep postgres | head -1` || exit_skip " MISSING"
echo " FOUND at" `dirname $HAVE_INITDB` echo " FOUND at" `dirname $HAVE_INITDB`
INITDB_BIN=`echo $HAVE_INITDB | grep bin/initdb | grep postgres | sort -n | tail -n1` INITDB_BIN=`echo $HAVE_INITDB | grep bin/initdb | grep postgres | sort -n | tail -n1`
fi fi

View File

@ -96,7 +96,7 @@ function cleanup()
function exit_cleanup() function exit_cleanup()
{ {
echo "Running exit-cleanup" echo "Running exit-cleanup"
if test ! -z ${POSTGRES_PATH:-} if [[ ! -z ${POSTGRES_PATH:-} ]]
then then
echo "Stopping Postgres at ${POSTGRES_PATH}" echo "Stopping Postgres at ${POSTGRES_PATH}"
${POSTGRES_PATH}/pg_ctl -D $TMPDIR -l /dev/null stop &> /dev/null || true ${POSTGRES_PATH}/pg_ctl -D $TMPDIR -l /dev/null stop &> /dev/null || true

View File

@ -32,7 +32,7 @@ function exit_fail() {
# Cleanup to run whenever we exit # Cleanup to run whenever we exit
function cleanup() { function cleanup() {
if test ! -z ${POSTGRES_PATH:-} if ! [[ -z ${POSTGRES_PATH:-} ]]
then then
${POSTGRES_PATH}/pg_ctl -D $TMPDIR stop &> /dev/null || true ${POSTGRES_PATH}/pg_ctl -D $TMPDIR stop &> /dev/null || true
fi fi