summaryrefslogtreecommitdiff
path: root/watchfilemodify_dothing.sh
blob: 36479960c162a911c2714745509281bd1a6b2e89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

file="/home/thomas/dev/localutilservice/localutil_webserver.py"

mtime=`stat -c %Y ${file}`
while [[ true ]]; do 
	while [[ $mtime == `stat -c %Y ${file}` ]]; do
		echo "still same modification time"
		sleep 2
		mtime=`stat -c %Y ${file}`
		echo "updated mtime ${mtime}"
	done
	echo "mtime was different. doing thing."
	thingtodo
done

function thingtodo () {
	kill `pgrep -f localutil`
}