1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
#!/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 /tmp/$port/stop exit_status=$((exit_status | $?)) rm -rf /tmp/$port exit_status=$((exit_status | $?)) done exit $exit_status |