Skip to content

add LDB connectivity check to automated script

Just dumping stuff here

curl -s --connect-timeout 5 http://example.com:8080 > /dev/null
echo $?

e.g.

STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://example.com:8080)

if [ "$STATUS" -eq 200 ]; then
    echo "Server is up!"
else
    echo "Server returned HTTP status: $STATUS"
fi