aboutsummaryrefslogtreecommitdiffstats
path: root/osmo-bts-master/respawn.sh
blob: 2413916318f6ccb8a5bd2ac742ee8adc2b6e59d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

trap "kill 0" EXIT

i=0
max_i=500
while [ $i -lt $max_i ]; do
	echo "$i: starting: $*"
	$* &
	LAST_PID=$!
	wait $LAST_PID
	echo "$i: stopped pid $LAST_PID with status $?"
	i=$(expr $i + 1)
done
echo "exiting after $max_i runs"