X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/525c5931383d1c7281c2d7bcabffe317c60ffe02..4058a47f317770d5cc5f5aa6b9f965b793f263bd:/Test/bin/remove-database diff --git a/Test/bin/remove-database b/Test/bin/remove-database new file mode 100755 index 000000000..5d4fcb0b8 --- /dev/null +++ b/Test/bin/remove-database @@ -0,0 +1,27 @@ +#!/bin/bash +set -e + +echo "GUI herunterfahren ..." +systemctl stop apache2 + +echo "Lösche bestende Datenbanken ..." +su postgres -c "psql -c 'DROP DATABASE IF EXISTS kivitendo_auth;'" +su postgres -c "psql -c 'DROP DATABASE IF EXISTS firma;'" + +echo "Lösche kivitendo-user" +su postgres -c "psql -c 'DROP USER kivitendo;'" + +echo "GUI starten ..." +systemctl start apache2 + +main=$(ls -d /etc/postgresql/*/main/) +awk '/kivitendo/ { + next; } + {print;} + ' $main/pg_hba.conf > /tmp/pg_hba.conf +mv /tmp/pg_hba.conf $main/pg_hba.conf +chown postgres:postgres $main/pg_hba.conf + + +echo "ok." +