mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-04 03:26:19 +00:00
Merge pull request #337 from percona/fix_CMD_MYSQL_and_CMD_MYSQLDUMP
PMM-2569: Fix passing CMD_MYSQL and CMD_MYSQLDUMP.
This commit is contained in:
@@ -827,7 +827,7 @@ setup_data_dir () {
|
|||||||
get_var () {
|
get_var () {
|
||||||
local varname="$1"
|
local varname="$1"
|
||||||
local file="$2"
|
local file="$2"
|
||||||
awk -v pattern="${varname}" '$1 == pattern { if (length($2)) { len = length($1); print substr($0, len+index(substr($0, len+1), $2)) } }' "${file}"
|
awk -v pattern="${varname}" '$1 == pattern { if (length($2)) { len = length($1); print substr($0, len+index(substr($0, len+1), $2)) } }' "${file}" | tr -d '\r'
|
||||||
}
|
}
|
||||||
|
|
||||||
# ###########################################################################
|
# ###########################################################################
|
||||||
@@ -2580,14 +2580,14 @@ check_mysql () {
|
|||||||
# Check that mysql and mysqldump are in PATH. If not, we're
|
# Check that mysql and mysqldump are in PATH. If not, we're
|
||||||
# already dead in the water, so don't bother with cmd line opts,
|
# already dead in the water, so don't bother with cmd line opts,
|
||||||
# just error and exit.
|
# just error and exit.
|
||||||
[ -n "$(mysql --help 2>/dev/null)" ] \
|
[ -n "$(${CMD_MYSQL} --help 2>/dev/null)" ] \
|
||||||
|| die "Cannot execute mysql. Check that it is in PATH."
|
|| die "Cannot execute mysql. Check that it is in PATH."
|
||||||
[ -n "$(mysqldump --help 2>/dev/null)" ] \
|
[ -n "$(${CMD_MYSQLDUMP} --help 2>/dev/null)" ] \
|
||||||
|| die "Cannot execute mysqldump. Check that it is in PATH."
|
|| die "Cannot execute mysqldump. Check that it is in PATH."
|
||||||
|
|
||||||
# Now that we have the cmd line opts, check that we can actually
|
# Now that we have the cmd line opts, check that we can actually
|
||||||
# connect to MySQL.
|
# connect to MySQL.
|
||||||
[ -n "$(mysql $EXT_ARGV -e 'SHOW STATUS')" ] \
|
[ -n "$(${CMD_MYSQL} ${EXT_ARGV} -e 'SHOW STATUS')" ] \
|
||||||
|| die "Cannot connect to MySQL. Check that MySQL is running and that the options after -- are correct."
|
|| die "Cannot connect to MySQL. Check that MySQL is running and that the options after -- are correct."
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user