mirror of
https://github.com/zadam/trilium.git
synced 2025-01-15 03:27:44 +08:00
Merge pull request #3213 from agentydragon/both-protos
Check both http and https in DockerHealthcheck
This commit is contained in:
commit
c5435009d7
1 changed files with 12 additions and 5 deletions
|
@ -1,6 +1,13 @@
|
|||
#!/bin/sh
|
||||
if wget --spider -S "127.0.0.1:8080/api/health-check" 2>&1 | awk 'NR==2' | grep -w "HTTP/1.1 200 OK" ; then
|
||||
|
||||
# Try connecting to /api/health-check using both http and https.
|
||||
# TODO: we should only be connecting with the actual protocol that is enabled
|
||||
# TODO: this assumes we use the default port 8080
|
||||
|
||||
for proto in http https; do
|
||||
if wget --spider -S "$proto://127.0.0.1:8080/api/health-check" 2>&1 | awk 'NR==2' | grep -w "HTTP/1.1 200 OK" ; then
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
exit 1
|
||||
|
|
Loading…
Reference in a new issue