5
echo "Watcher: Bad args: $#"
14
echo "Watcher: Check PID: $CHECK_PID"
15
echo "Watcher: Directory: $DIR"
16
echo "Watcher: File: $FILE"
17
echo "Watcher: Grep for: $GREP_FOR"
19
if [ -d "$DIR" ]; then
20
if [ -f "$DIR/watcher-lock" ]; then
21
echo "Watcher: not spawning as lock in place"
24
echo "Watcher: creating lock"
25
touch $DIR/watcher-lock
29
# If the PID we are told still exists (our caller is still running),
30
# the directory we are told (the working directory still exists) and
31
# the file we are told doesn't exist (the build stamp hasn't been created)
33
while ps "$CHECK_PID" > /dev/null &&
39
ps ux | grep -- "$GREP_FOR" | grep -v grep
42
echo "Watcher: Terminating."
43
echo "Watcher: Removing lock"
44
[ -f $DIR/watcher-lock ] && rm $DIR/watcher-lock
b'\\ No newline at end of file'