mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 13:11:32 +00:00
37 lines
929 B
Bash
Executable File
37 lines
929 B
Bash
Executable File
#!/bin/sh
|
|
|
|
die() {
|
|
echo
|
|
for msg; do
|
|
echo $msg
|
|
done
|
|
exit_status=1
|
|
}
|
|
|
|
# ###########################################################################
|
|
# Sanity check the cmd line options.
|
|
# ###########################################################################
|
|
if [ $# -lt 1 ]; then
|
|
die "Usage: load-sakila-db PORT"
|
|
fi
|
|
|
|
PORT=$1
|
|
|
|
if [ ! -d "/tmp/$PORT" ]; then
|
|
die "MySQL test server does not exist: /tmp/$PORT"
|
|
fi
|
|
|
|
# ###########################################################################
|
|
# Sanity check the environment.
|
|
# ###########################################################################
|
|
if [ -z "$PERCONA_TOOLKIT_BRANCH" ]; then
|
|
die "PERCONA_TOOLKIT_BRANCH environment variable is not set."
|
|
fi
|
|
|
|
if [ ! -d "$PERCONA_TOOLKIT_BRANCH" ]; then
|
|
die "Invalid PERCONA_TOOLKIT_BRANCH directory: $PERCONA_TOOLKIT_BRANCH"
|
|
fi
|
|
|
|
/tmp/$PORT/use < $PERCONA_TOOLKIT_BRANCH/sandbox/sakila.sql
|
|
exit $?
|