#!/bin/bash

echo "WARN: This script is deprecated and will soon be removed"

watch_dir=${1:-/tmp/ansible-operator/runner}
filename=${2:-stdout}
mkdir -p ${watch_dir}
inotifywait -r -m -e close_write ${watch_dir} | while read dir op file
do
  if [[ "${file}" = "${filename}" ]] ; then
    echo "${dir}/${file}"
    cat ${dir}/${file}
  fi
done
