X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/a9b0b58d0f5f786542ab152e825cd4a878fec48b..ead4bcd581bcaace363f9647b46c37c850e2fa5c:/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." +