Automatically reload the /photos/ index files.

This commit is contained in:
Hyperling 2025-05-26 18:53:19 -07:00
parent 6fd8525dad
commit add3a2865c

10
run.sh
View File

@ -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 ##