diff options
-rwxr-xr-x | contrib/taler-auditor-dbconfig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/taler-auditor-dbconfig b/contrib/taler-auditor-dbconfig index 1d70f7657..5542a037e 100755 --- 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 |