summaryrefslogtreecommitdiff
path: root/watchfilemodify_dothing.sh
diff options
context:
space:
mode:
authorthomas grothe <thomas@debian>2023-08-22 01:44:25 -0500
committerthomas grothe <thomas@debian>2023-08-22 01:44:25 -0500
commitedb3ee99f6a0f994bb9ee29ede66a2e0456c9b84 (patch)
tree6e16cbad168e1cd5a5314a1ae1e4a26f5b8eddf9 /watchfilemodify_dothing.sh
parent7471e3732c128eec9c993481fdae7b925052d429 (diff)
some updates
Diffstat (limited to 'watchfilemodify_dothing.sh')
-rwxr-xr-xwatchfilemodify_dothing.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/watchfilemodify_dothing.sh b/watchfilemodify_dothing.sh
new file mode 100755
index 0000000..3647996
--- /dev/null
+++ b/watchfilemodify_dothing.sh
@@ -0,0 +1,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`
+}