监控服务是否存活脚本


HEALTHY_URL = "http://127.0.0.1:8080/alive"

RESP=curl —-connect-timeout 3 -s ${HEALTHY_URL}

if [ "$RESP" == "ok"]; then
echo "Server is running."
exit 1
else
echo "Serve was exit."
exit 0
fi