feat: Update 7 files
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 35s
Build-Test-Publish / build (linux/arm64) (push) Successful in 3m15s

This commit is contained in:
j
2026-01-02 22:27:40 +13:00
parent 767692160d
commit ae5a6fabe9
7 changed files with 95 additions and 2 deletions

View File

@@ -38,6 +38,24 @@ if [[ ! -f "${AGENT_PATH}/common.sh" ]]; then
fi
source "${AGENT_PATH}/common.sh"
# -- Check agent hash (if AGENT_HASH is provided by dropshell) --
# Exit code 199 = agent mismatch (special code for dropshell to detect)
if [[ -n "${AGENT_HASH:-}" ]]; then
LOCAL_HASH_FILE="${AGENT_PATH}/agent.hash"
if [[ -f "${LOCAL_HASH_FILE}" ]]; then
LOCAL_HASH=$(cat "${LOCAL_HASH_FILE}" | tr -d '[:space:]')
EXPECTED_HASH=$(echo "${AGENT_HASH}" | tr -d '[:space:]')
if [[ "${LOCAL_HASH}" != "${EXPECTED_HASH}" ]]; then
echo "AGENT_MISMATCH:${EXPECTED_HASH}:${LOCAL_HASH}" >&2
exit 199
fi
else
# No local hash file - agent is outdated (pre-hash version)
echo "AGENT_MISMATCH:${AGENT_HASH}:no_hash_file" >&2
exit 199
fi
fi
# -- Validate arguments --
if [[ $# -lt 2 ]]; then
echo "Usage: ds_run.sh SERVICE COMMAND [args...]" >&2