Skip to content

Commit f5b6830

Browse files
author
Ryan Faircloth
authored
Correct syntax error in checkstate not caught by unit tests (#438)
* fix: checkstate script to honor SPLUNKD_SSL_ENABLE * Update checkstate.sh * Update checkstate.sh
1 parent 3023303 commit f5b6830

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

splunk/common-files/checkstate.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,19 @@
2121
#NOTE: If you plan on running the splunk container while keeping Splunk
2222
# inactive for long periods of time, this script may give misleading
2323
# health results
24+
2425
if [[ "" == "$NO_HEALTHCHECK" ]]; then
26+
if [[ "false" == "$SPLUNKD_SSL_ENABLE" ]]; then
27+
SCHEME="http"
28+
else
29+
SCHEME="https"
30+
fi
2531
#If NO_HEALTHCHECK is NOT defined, then we want the healthcheck
2632
state="$(< $CONTAINER_ARTIFACT_DIR/splunk-container.state)"
2733

2834
case "$state" in
2935
running|started)
30-
if [[ "false" != "$SPLUNKD_SSL_ENABLE" ]]; then
31-
curl -m 30 -f -k https://localhost:8089/
32-
else
33-
curl -m 30 -f -k http://localhost:8089/
36+
curl -m 30 -f -k $SCHEME://localhost:8089/
3437
exit $?
3538
;;
3639
*)

0 commit comments

Comments
 (0)