diff options
Diffstat (limited to 'base/all/usr/bin/waitfor')
-rwxr-xr-x | base/all/usr/bin/waitfor | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/base/all/usr/bin/waitfor b/base/all/usr/bin/waitfor deleted file mode 100755 index cb296d3..0000000 --- a/base/all/usr/bin/waitfor +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# wait for a string to appear at the end of file -# tridge@samba.org July 2008 - -[ $# -lt 3 ] && { - cat <<EOF -Usage: waitfor FILE MESSAGE TIMEOUT -EOF -exit 1 -} - -file="$1" -msg="$2" -timeout="$3" - -tmpfile=`mktemp` - -cat <<EOF > $tmpfile -spawn tail -n 10000 -f $file -expect -timeout $timeout "$msg" -EOF - -expect $tmpfile -rm -f $tmpfile - -if ! grep "$msg" $file > /dev/null; then - echo "Failed to find \"$msg\" in $file" - exit 1 -fi -exit 0 |