Skip to content

Commit

Permalink
Merge pull request #51 from fradelg/support-hyphen-in-db-name
Browse files Browse the repository at this point in the history
relax regex in grep from Database
  • Loading branch information
fradelg authored May 24, 2021
2 parents 27ce6e2 + e911147 commit 4ee035f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SQL=$(gunzip -c "$1")
DB_NAME=${MYSQL_DATABASE:-${MYSQL_DB}}
if [ -z "${DB_NAME}"]
then
DB_NAME=$(echo "$SQL" | grep -oE '(Database: (\w*))' | cut -d ' ' -f 2)
DB_NAME=$(echo "$SQL" | grep -oE '(Database: (.+))' | cut -d ' ' -f 2)
fi
[ -z "${DB_NAME}" ] && { echo "=> database name cannot be found" && exit 1; }

Expand Down

0 comments on commit 4ee035f

Please sign in to comment.