Adds missing gunzip command

This commit adds a gunzip command which extracts the gzip'd SQL dump and
pipes it into the mysql command. Without the restore fails.
This commit is contained in:
Markus "Shorty" Uckelmann 2017-09-07 17:18:55 +02:00
parent 44cdee455a
commit 95c36b6493

3
restore.sh Normal file → Executable file
View file

@ -8,7 +8,8 @@ then
fi
echo "=> Restore database from $1"
if mysql -h "$MYSQL_HOST" -P "$MYSQL_PORT" -u "$MYSQL_USER" -p"$MYSQL_PASS" < "$1"
set -o pipefail
if gunzip --stdout "$1" | mysql -h "$MYSQL_HOST" -P "$MYSQL_PORT" -u "$MYSQL_USER" -p"$MYSQL_PASS"
then
echo "=> Restore succeeded"
else