commit 2b0814d69a1ac675f317ed913d05c882b3bcee6d
parent 31d044f8cf4a711f3f9512a5b043fa3741a2f3b2
Author: Florian Dold <florian@dold.me>
Date: Mon, 26 Aug 2024 20:36:41 +0200
taler-auditor-dbconfig: set DBNAME
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/contrib/taler-auditor-dbconfig b/contrib/taler-auditor-dbconfig
@@ -88,6 +88,11 @@ if ! echo "$DBPATH" | grep "postgres://" >/dev/null; then
exit 1
fi
+DBNAME=$(echo "$DBPATH" |
+ sed \
+ -e "s/postgres:\/\/.*\///" \
+ -e "s/?.*//")
+
if sudo -i -u postgres psql "$DBNAME" </dev/null 2>/dev/null; then
if [ 1 = "$RESET_DB" ]; then
echo "Deleting existing database '$DBNAME'." 1>&2