#!/bin/bash set -x -e SENTINEL_PORTS="26381 26382 26383" CONFFILES=() function clean_exit(){ local error_code="$?" local spawned=$(jobs -p) if [ -n "$spawned" ]; then kill $(jobs -p) fi wait $spawned rm /tmp/sentinel.2638[123].log || true rm ${CONFFILES[@]} || true return $error_code } function write_conf_file() { local port=$1 local conffile=$(mktemp -t tooz-sentinel-$port-XXXXXX) cat > $conffile <