From caa1fef39d2a8f5eef7fd5b83c42a225d9b02077 Mon Sep 17 00:00:00 2001 From: Igor Kalashnikov Date: Sat, 5 Dec 2015 22:42:15 +0300 Subject: [PATCH] support for sql.gz dump restore --- 10.0/docker-entrypoint.sh | 7 ++++--- 5.5/docker-entrypoint.sh | 7 ++++--- docker-entrypoint.sh | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/10.0/docker-entrypoint.sh b/10.0/docker-entrypoint.sh index 19b40b7a..ea8b9538 100755 --- a/10.0/docker-entrypoint.sh +++ b/10.0/docker-entrypoint.sh @@ -80,9 +80,10 @@ if [ "$1" = 'mysqld' ]; then echo for f in /docker-entrypoint-initdb.d/*; do case "$f" in - *.sh) echo "$0: running $f"; . "$f" ;; - *.sql) echo "$0: running $f"; "${mysql[@]}" < "$f" && echo ;; - *) echo "$0: ignoring $f" ;; + *.sh) echo "$0: running $f"; . "$f" ;; + *.sql) echo "$0: running $f"; "${mysql[@]}" < "$f" && echo ;; + *.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${mysql[@]}" && echo ;; + *) echo "$0: ignoring $f" ;; esac echo done diff --git a/5.5/docker-entrypoint.sh b/5.5/docker-entrypoint.sh index 19b40b7a..ea8b9538 100755 --- a/5.5/docker-entrypoint.sh +++ b/5.5/docker-entrypoint.sh @@ -80,9 +80,10 @@ if [ "$1" = 'mysqld' ]; then echo for f in /docker-entrypoint-initdb.d/*; do case "$f" in - *.sh) echo "$0: running $f"; . "$f" ;; - *.sql) echo "$0: running $f"; "${mysql[@]}" < "$f" && echo ;; - *) echo "$0: ignoring $f" ;; + *.sh) echo "$0: running $f"; . "$f" ;; + *.sql) echo "$0: running $f"; "${mysql[@]}" < "$f" && echo ;; + *.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${mysql[@]}" && echo ;; + *) echo "$0: ignoring $f" ;; esac echo done diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 19b40b7a..ea8b9538 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -80,9 +80,10 @@ if [ "$1" = 'mysqld' ]; then echo for f in /docker-entrypoint-initdb.d/*; do case "$f" in - *.sh) echo "$0: running $f"; . "$f" ;; - *.sql) echo "$0: running $f"; "${mysql[@]}" < "$f" && echo ;; - *) echo "$0: ignoring $f" ;; + *.sh) echo "$0: running $f"; . "$f" ;; + *.sql) echo "$0: running $f"; "${mysql[@]}" < "$f" && echo ;; + *.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${mysql[@]}" && echo ;; + *) echo "$0: ignoring $f" ;; esac echo done