fix(healthcheck): use address configured if not empty

1. Use `$FB_ADDRESS` content if not empty;
2. Fallback on "address" value in /.filebrowser.json
3. Fallback on `localhost`
This commit is contained in:
Quentin McGaw 2024-01-16 15:57:40 +01:00 committed by GitHub
parent 04e03a83b4
commit 922d75e67b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,5 @@
#!/bin/sh
PORT=${FB_PORT:-$(jq .port /.filebrowser.json)}
curl -f http://localhost:$PORT/health || exit 1
ADDRESS=${FB_ADDRESS:-$(jq .address /.filebrowser.json)}
ADDRESS=${ADDRESS:-localhost}
curl -f http://$ADDRESS:$PORT/health || exit 1