INNER CODE UNIT · Shell
cur
okx/agent-skills · skills/earn-hunter/scripts/scan.sh:400
cur=$((cur + 1))
local tmp
tmp=$(jq --argjson c "$cur" --arg e "$emsg" '.consecutive_failures=$c | .last_error=$e' "$STATE_FILE" 2>/dev/null)
[[ -n "$tmp" ]] && printf '%s\n' "$tmp" > "$STATE_FILE"
if [[ "$cur" -ge 3 ]]; then
local title body err_display
if [[ -z "$emsg" ]]; then
if [[ "$LANG_SEL" == en ]]; then
err_display="(no error captured — likely cron PATH issue, check ~/.okx/earn-hunter/cron.log)"
else
err_display="(未捕获到错误信息 — 通常是 cron 的 PATH 找不到 okx/node,请查看 ~/.okx/earn-hunter/cron.log)"
fi
else
err_display="$emsg"
fi
if [[ "$LANG_SEL" == en ]]; then
title="🚨 Earn Hunter · 3 consecutive scan failures"