isle/tests/utils/cleanup-single-node-cluster.sh

15 lines
353 B
Bash
Raw Normal View History

2023-09-04 18:56:48 +00:00
(
set -e
TMPDIR="$TMPDIR/shared/single-node.tmp"
if [ ! -d "$TMPDIR" ]; then exit 0; fi
lock_file="$TMPDIR/.run/isle/lock"
if [ ! -e "$lock_file" ]; then exit 0; fi
pid="$(cat "$lock_file")"
echo "killing shared single node cluster (process: $pid)"
kill "$pid"
while [ -e "$TMPDIR/.run/isle" ]; do sleep 1; done
)