From: Guillaume Pellerin Date: Tue, 17 Oct 2017 14:09:08 +0000 (+0200) Subject: Just use env variables X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=c51c6c60f1e4ff82b0cbd25e5fac6ca9e147b7e1;p=docker-django-scripts.git Just use env variables --- diff --git a/db/restore.sh b/db/restore.sh index 0263451..3531fe7 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