-clean up scripts
This commit is contained in:
parent
035e052c39
commit
7d40cd1904
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# This file is part of TALER
|
# This file is part of TALER
|
||||||
# Copyright (C) 2014-2021 Taler Systems SA
|
# Copyright (C) 2014-2022 Taler Systems SA
|
||||||
#
|
#
|
||||||
# TALER is free software; you can redistribute it and/or modify it under the
|
# TALER 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
|
# terms of the GNU General Public License as published by the Free Software
|
||||||
|
@ -120,8 +120,10 @@ else
|
|||||||
fi
|
fi
|
||||||
echo -n "Setting up Postgres DB"
|
echo -n "Setting up Postgres DB"
|
||||||
POSTGRES_PATH=`dirname $INITDB_BIN`
|
POSTGRES_PATH=`dirname $INITDB_BIN`
|
||||||
TMPDIR=`mktemp -d /tmp/taler-test-postgresXXXXXX`
|
MYDIR=`mktemp -d /tmp/taler-auditor-basedbXXXXXX`
|
||||||
$INITDB_BIN --no-sync --auth=trust -D ${TMPDIR} > postgres-dbinit.log 2> postgres-dbinit.err
|
TMPDIR="$MYDIR/postgres/"
|
||||||
|
mkdir -p $TMPDIR
|
||||||
|
$INITDB_BIN --no-sync --auth=trust -D ${TMPDIR} > ${MYDIR}/postgres-dbinit.log 2> ${MYDIR}/postgres-dbinit.err
|
||||||
echo " DONE"
|
echo " DONE"
|
||||||
mkdir ${TMPDIR}/sockets
|
mkdir ${TMPDIR}/sockets
|
||||||
echo -n "Launching Postgres service"
|
echo -n "Launching Postgres service"
|
||||||
@ -135,12 +137,11 @@ listen_addresses=''
|
|||||||
EOF
|
EOF
|
||||||
cat $TMPDIR/pg_hba.conf | grep -v host > $TMPDIR/pg_hba.conf.new
|
cat $TMPDIR/pg_hba.conf | grep -v host > $TMPDIR/pg_hba.conf.new
|
||||||
mv $TMPDIR/pg_hba.conf.new $TMPDIR/pg_hba.conf
|
mv $TMPDIR/pg_hba.conf.new $TMPDIR/pg_hba.conf
|
||||||
${POSTGRES_PATH}/pg_ctl -D $TMPDIR -l /dev/null start > postgres-start.log 2> postgres-start.err
|
${POSTGRES_PATH}/pg_ctl -D $TMPDIR -l /dev/null start > ${MYDIR}/postgres-start.log 2> ${MYDIR}/postgres-start.err
|
||||||
echo " DONE"
|
echo " DONE"
|
||||||
PGHOST="$TMPDIR/sockets"
|
PGHOST="$TMPDIR/sockets"
|
||||||
export PGHOST
|
export PGHOST
|
||||||
|
|
||||||
MYDIR=`mktemp -d /tmp/taler-auditor-basedbXXXXXX`
|
|
||||||
echo "Generating fresh database at $MYDIR"
|
echo "Generating fresh database at $MYDIR"
|
||||||
if faketime -f '-1 d' ./generate-auditor-basedb.sh $MYDIR/auditor-basedb
|
if faketime -f '-1 d' ./generate-auditor-basedb.sh $MYDIR/auditor-basedb
|
||||||
then
|
then
|
||||||
@ -151,7 +152,6 @@ then
|
|||||||
else
|
else
|
||||||
echo "Cleaning up $MYDIR..."
|
echo "Cleaning up $MYDIR..."
|
||||||
rm -rf $MYDIR || echo "Removing $MYDIR failed"
|
rm -rf $MYDIR || echo "Removing $MYDIR failed"
|
||||||
rm -rf $TMPDIR || echo "Removing $TMPDIR failed"
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Generation failed"
|
echo "Generation failed"
|
||||||
|
Loading…
Reference in New Issue
Block a user