mirror of
https://github.com/zadam/trilium.git
synced 2024-12-26 01:01:26 +08:00
1d3132e447
I've been getting Docker reporting my Trilium container as unhealthy because wget was trying to talk HTTP to it while it was expecting HTTPS.
13 lines
389 B
Bash
Executable file
13 lines
389 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# 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
|
|
fi
|
|
done
|
|
|
|
exit 1
|