mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-07 04:49:48 +00:00
33 lines
531 B
Bash
Executable File
33 lines
531 B
Bash
Executable File
#!/bin/sh
|
|
|
|
die() {
|
|
echo $1 >&2
|
|
exit 1
|
|
}
|
|
|
|
if [ $# -lt 1 ]; then
|
|
die "Usage: stop-sandbox PORTS"
|
|
fi
|
|
|
|
exit_status=0
|
|
|
|
for port in "$@"; do
|
|
if ! [ -d "/tmp/$port" ]; then
|
|
echo "MySQL test server on port $port does not exist."
|
|
continue
|
|
fi
|
|
|
|
if [ -x "/tmp/$port/stop" ]; then
|
|
/tmp/$port/stop
|
|
exit_status=$((exit_status | $?))
|
|
else
|
|
echo "/tmp/$port is missing files:" >&2
|
|
ls -la /tmp/$port >&2
|
|
fi
|
|
|
|
rm -rf /tmp/$port
|
|
exit_status=$((exit_status | $?))
|
|
done
|
|
|
|
exit $exit_status
|