mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-12-18 02:06:49 +08:00
Fix find cmd and mysqld -V test. wget to explicit file name.
This commit is contained in:
@@ -32,22 +32,21 @@ MYSQL_BIN_DIR="$HOME/mysql-bin"
|
|||||||
[ -d "$MYSQL_BIN_DIR" ] || mkdir "$MYSQL_BIN_DIR"
|
[ -d "$MYSQL_BIN_DIR" ] || mkdir "$MYSQL_BIN_DIR"
|
||||||
|
|
||||||
find_mysql_base_dir() {
|
find_mysql_base_dir() {
|
||||||
find "$MYSQL_BIN_DIR" -name "mysql-$1\*" -type -d | tail -n 1
|
find "$MYSQL_BIN_DIR" -name "mysql-$1\*" -type d | tail -n 1
|
||||||
}
|
}
|
||||||
|
|
||||||
MYSQL_BASE_DIR=$(find_mysql_base_dir $MYSQL)
|
MYSQL_BASE_DIR=$(find_mysql_base_dir $MYSQL)
|
||||||
if [ -z "$MYSQL_BASE_DIR" ]; then
|
if [ -z "$MYSQL_BASE_DIR" ]; then
|
||||||
(
|
(
|
||||||
cd $MYSQL_BIN_DIR
|
cd $MYSQL_BIN_DIR
|
||||||
wget -q http://hackmysql.com/barebones/mysql/$MYSQL/$ARCH
|
wget -q -O mysql.tar.gz http://hackmysql.com/barebones/mysql/$MYSQL/$ARCH
|
||||||
tarball=$(ls -t1 | head -n1)
|
tar xvfz mysql.tar.gz
|
||||||
tar xvfz "$tarball"
|
rm mysql.tar.gz
|
||||||
rm "$tarball"
|
|
||||||
)
|
)
|
||||||
MYSQL_BASE_DIR=$(find_mysql_base_dir $MYSQL)
|
MYSQL_BASE_DIR=$(find_mysql_base_dir $MYSQL)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$MYSQL_BASE_DIR/bin/mysqld -V" ]; then
|
if [ -z $("$MYSQL_BASE_DIR/bin/mysqld" -V) ]; then
|
||||||
echo "$MYSQL_BASE_DIR/bin/mysqld does not execute" >&2
|
echo "$MYSQL_BASE_DIR/bin/mysqld does not execute" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user