wait-for-file 232 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #!/bin/sh set -ex trap 'exit' TERM while ! [ -e $WAIT_FOR_FILE ]; do echo "Waiting for file: $WAIT_FOR_FILE" 1>&2 sleep 1 count=5 while ! [ -e $WAIT_FOR_FILE && $count -gt 0 ]; do count=$(($count - 1)) sleep 1 done done