hcp-ansible/playbooks/tasks/haproxy/files/keepalived/scripts.d/chk_haproxy.sh
Bertrand Lanson b32815066f
All checks were successful
development / Check commit compliance (push) Successful in 1m33s
feat: use new vault and consul roles, and only allow for host deployment after docker support drop
2024-06-20 00:32:33 +02:00

16 lines
268 B
Bash

#!/bin/bash
set -e
function do_ping() {
wget -q -O /dev/null --server-response "http://127.0.0.1:9000/health" 2>&1 | awk '/^ HTTP/{print $2}'
}
ping_result=$(do_ping)
echo "Ping result: $ping_result"
if [ "$ping_result" = "200" ]; then
exit 0
else
exit 1
fi