mirror of
https://github.com/fradelg/docker-mysql-cron-backup.git
synced 2024-11-01 08:31:45 +01:00
Merge pull request #51 from fradelg/support-hyphen-in-db-name
relax regex in grep from Database
This commit is contained in:
commit
4ee035f7d1
1 changed files with 1 additions and 1 deletions
|
@ -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; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue