summaryrefslogtreecommitdiffstats
path: root/autorestart
blob: 8fdcc4261e05d6a0232feb91b297c6d53c9a5008 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
# Use this if you get tired of restarting the program after every change/rebuild cycle :)

ARGS=$@
while true; do
	STAT=`stat synapse modules/*.module/*.so`
	#echo $STAT
	if [ "$STAT" != "$OLDSTAT" ]; then
		OLDSTAT=$STAT
		killall -9 synapse
		sleep 1
		echo "############# PROGRAM CHANGED, RESTARTING #############"
		./synapse $ARGS &
	fi
	sleep 2 || exit 0
done