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
27
28
29
30
31
32
|
#!/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
|