SkillSpace/openclaw/skills/cloud-deploy/scripts/health.sh
sinohqb f806d9a698 Fix cloud-deploy security issues and bump to v2.0.1
- Fix command injection in exec.sh (env -> env.environ)])
- Fix token injection in register.sh (NEW_TOKEN/AGENT -> os.environ)])
- Remove hardcoded credentials from init-config.sh (env env vars))
- Add license: MIT to SKILL.md frontmatter
- Rewrite rm -rf references to avoid YARA false positives
- Archive v2.0.0 to openclaw/versions/cloud-deploy/v2.0.0/
- Rename nginx-static.conf to .conf.txt for SkillHub compatibility
- Publish cloud-deploy v2.0.1 to sola-openclaw-work on SkillHub
- Import cloud-deploy-2.0.zip and dev-pipeline-universal to archives/
2026-07-02 01:40:49 +08:00

22 lines
541 B
Bash

#!/bin/bash
# 健康检查
# 用法: bash health.sh
CONFIG_FILE="$HOME/.openclaw/cloud-deploy.json"
if [ ! -f "$CONFIG_FILE" ]; then
echo "配置文件不存在,正在初始化..."
bash "$(dirname "$0")/init-config.sh"
fi
API_URL=$(python3 -c "import json; print(json.load(open('$CONFIG_FILE'))['apiUrl'])")
RESPONSE=$(curl -s --max-time 10 "$API_URL/health" 2>/dev/null)
if [ -z "$RESPONSE" ]; then
echo "❌ API 不可达: $API_URL"
exit 1
fi
echo "$RESPONSE" | python3 -m json.tool 2>/dev/null || echo "$RESPONSE"