function wait_for_file { FILE=$1 while [ ! -f ${FILE} ]; do sleep 1; done }