diff --git a/run.sh b/run.sh index adf5d8d..ced1bcd 100755 --- a/run.sh +++ b/run.sh @@ -78,6 +78,16 @@ npm install # Reset generated index files. echo "`date` - Removing old index files." find files/photos/ -name "*".html -print -delete +{ + http_code=0 + while [[ $http_code != "200" ]]; do + sleep 1 + echo "`date` - Checking if /photos/ is ready yet." + http_code="`curl --silent --fail --w '\n%{http_code}' localhost:8080/photos | tail -n 1`" + echo "`date` - Check for /photos/ responded with '$http_code'." + done + echo "`date` - Finished loading /photos/." +} & ## Main ##