Fix scripts

This commit is contained in:
Emmanuel Viennet 2021-04-22 22:14:25 +02:00
parent 7bed86f620
commit 314ed4ab7d
2 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@
# E. Viennet, Juin 2008
#
set -euo pipefail
set -eo pipefail
source config.sh
source utils.sh

View File

@ -60,7 +60,7 @@ then
# suppression de la base postgres
db_name=$(sed '/^dbname=*/!d; s///;q' < "$cfg_pathname")
if su -c "psql -lt" "$POSTGRES_SUPERUSER" | cut -d \| -f 1 | grep -wq SCORT
if su -c "psql -lt" "$POSTGRES_SUPERUSER" | cut -d \| -f 1 | grep -wq "$db_name"
then
echo "Suppression de la base postgres $db_name ..."
su -c "dropdb $db_name" "$POSTGRES_SUPERUSER" || terminate "ne peux supprimer base de donnees $db_name"