From 9fe3298f07f619647d26b5ccb0857c0aded621b2 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 23 Oct 2017 11:08:16 +0200 Subject: [PATCH] Just use env variable to select DB mode --- db/restore.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db/restore.sh b/db/restore.sh index 94ba8c3..7d20816 100755 --- a/db/restore.sh +++ b/db/restore.sh @@ -1,14 +1,14 @@ #!/bin/bash # import dump functions of the database (postgres or mysql) -export POSTGRES="$(dpkg --get-selections | grep postgres 2>&1)" -export MYSQL="$(dpkg --get-selections | grep mysql 2>&1)" +# export POSTGRES="$(dpkg --get-selections | grep postgres 2>&1)" +# export MYSQL="$(dpkg --get-selections | grep mysql 2>&1)" -if [ ! -z "$MYSQL" ]; +if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then export MYSQL_PWD=$MYSQL_ROOT_PASSWORD mysql -h db $MYSQL_DATABASE -uroot < /srv/backup/mariadb.dump -elif [ ! -z "$POSTGRES" ]; +elif [ ! -z "$POSTGRES_PASSWORD" ]; then export PGUSER="postgres" export PGPASSWORD=$POSTGRES_PASSWORD -- 2.39.5