forked from securitybunker/databunker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
health-check.sh
executable file
·25 lines (21 loc) · 836 Bytes
/
health-check.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
# check if Databunker is using SSL port
if [ -n "$SSL_CERTIFICATE" ]; then
if [ -f "$SSL_CERTIFICATE" ]; then
/bin/busybox wget --tries=1 --spider --no-check-certificate -q https://localhost:3000/status || exit 1
exit 0
fi
fi
if [ -f "/databunker/certs/server.cer" ]; then
/bin/busybox wget --tries=1 --spider --no-check-certificate -q https://localhost:3000/status || exit 1
exit 0
fi
CERT_FILE=`/bin/busybox sed -n -e '/ssl_certificate:/ s/ .*ssl_certificate: "\(.*\)"/\1/p' /databunker/conf/databunker.yaml`
if [ -n "$CERT_FILE" ]; then
if [ -f "$CERT_FILE" ]; then
/bin/busybox wget --tries=1 --spider --no-check-certificate -q https://localhost:3000/status || exit 1
exit 0
fi
fi
# by default check http port
/bin/busybox wget --tries=1 --spider -q http://localhost:3000/status || exit 1