build(utils/watchrun.sh): File watcher for running commands.

This commit is contained in:
Stephan Barth 2024-10-07 14:40:44 +02:00
parent bae8ccc45a
commit c5409ad902

18
utils/watchrun.sh Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
FILENAME=$1
STARTSCRIPT=$2
STOPSCRIPT=$3
touch "$FILENAME"
$STARTSCRIPT &
while [ -e "$FILENAME" ] ; do
inotifywait -e ATTRIB -t 10 "$FILENAME" > /dev/null 2&>/dev/null
done
kill %1
$STOPSCRIPT