修bug,完善功能
This commit is contained in:
1 parent
30364b1c4b
commit
6996e19694
125 files changed
+15343
-3746
No files matched your search
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
# 检查 TCP 协议响应或 Web 健康接口,不读取账号口令。
|
||||
case "${1:-server}" in
|
||||
server)
|
||||
response=$(printf '{"method":"ping"}\n{"method":"quit"}\n' | nc -w 3 127.0.0.1 7777)
|
||||
printf '%s\n' "$response" | grep -Eq '"status"[[:space:]]*:[[:space:]]*"pong"'
|
||||
;;
|
||||
web)
|
||||
curl --fail --silent --show-error --max-time 3 http://127.0.0.1:7778/api/health >/dev/null
|
||||
;;
|
||||
*)
|
||||
echo "Unknown healthcheck service: $1" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in new issue
Block a user