diff --git a/src/mage2-db-code-backup.sh b/src/mage2-db-code-backup.sh index 66fef60..4a7452d 100755 --- a/src/mage2-db-code-backup.sh +++ b/src/mage2-db-code-backup.sh @@ -294,10 +294,10 @@ function createDbBackup() _success "Dumping MySQL..." local host username password dbName # TODO FIX if there are multiple occurences - host=$(grep host "${M2_SRC_DIR}/app/etc/env.php" | cut -d "'" -f 4) - username=$(grep username "${M2_SRC_DIR}/app/etc/env.php" | cut -d "'" -f 4) - password=$(grep password "${M2_SRC_DIR}/app/etc/env.php" | cut -d "'" -f 4) - dbName=$(grep dbname "${M2_SRC_DIR}/app/etc/env.php" |cut -d "'" -f 4) + host=$(grep host "${M2_SRC_DIR}/app/etc/env.php" | head -1 | cut -d "'" -f 4) + username=$(grep username "${M2_SRC_DIR}/app/etc/env.php" | head -1 | cut -d "'" -f 4) + password=$(grep password "${M2_SRC_DIR}/app/etc/env.php" | head -1 | cut -d "'" -f 4) + dbName=$(grep dbname "${M2_SRC_DIR}/app/etc/env.php" | head -1 | cut -d "'" -f 4) # @todo option to skip log tables if [[ "$M2_USE_MYSQL_CONFIG" -eq 1 ]]; then