Primul heartbeat real manual de pe mini PC către Guard. Doar metadata tehnică, fără pairing, fără camere, fără stream, fără media.
M9.4 enables the first real manual heartbeat receiver. The mini PC can send a metadata-only heartbeat to Guard by manually running the generated script. No service, cron, pairing, production, camera discovery, stream, media or billing is enabled.
#!/bin/bash
set -e
echo "=================================================="
echo "DERIOX GUARD - MANUAL HEARTBEAT M9.4"
echo "=================================================="
echo "This sends one metadata-only heartbeat to Guard."
echo "It does NOT pair, does NOT start a service, does NOT scan cameras,"
echo "does NOT send camera passwords, streams or media."
echo ""
CONF="/etc/deriox-guard/agent.env"
GUARD_URL="https://guard.deriox.ro"
AGENT_NAME="mini-pc-pilot-01"
GATEWAY_UUID=""
if [ -f "$CONF" ]; then
# shellcheck disable=SC1090
source "$CONF" || true
if [ -n "${DERIOX_GUARD_URL:-}" ]; then GUARD_URL="$DERIOX_GUARD_URL"; fi
if [ -n "${DERIOX_AGENT_NAME:-}" ]; then AGENT_NAME="$DERIOX_AGENT_NAME"; fi
if [ -n "${DERIOX_GATEWAY_UUID:-}" ]; then GATEWAY_UUID="$DERIOX_GATEWAY_UUID"; fi
fi
HOST_NAME="$(hostname 2>/dev/null || echo unknown)"
OS_NAME="$(uname -a 2>/dev/null | sed 's/"/'\''/g')"
UPTIME_SECONDS="$(cut -d. -f1 /proc/uptime 2>/dev/null || echo 0)"
LOCAL_IP="$(hostname -I 2>/dev/null | awk '{print $1}' || echo '')"
if [ -z "$GATEWAY_UUID" ]; then
MACHINE_ID="$(cat /etc/machine-id 2>/dev/null || hostname)"
GATEWAY_UUID="manual-${HOST_NAME}-$(printf "%s" "$MACHINE_ID" | sha256sum | awk '{print substr($1,1,16)}')"
fi
PAYLOAD=$(cat <<JSON
{
"gateway_uuid": "$GATEWAY_UUID",
"agent_name": "$AGENT_NAME",
"agent_version": "m9.4-manual-heartbeat",
"host_name": "$HOST_NAME",
"os_name": "$OS_NAME",
"local_ip": "$LOCAL_IP",
"uptime_seconds": "$UPTIME_SECONDS",
"manual_run": 1,
"service_autostart_enabled": 0,
"cron_enabled": 0,
"real_pairing_enabled": 0,
"production_go_live_enabled": 0,
"real_camera_access_enabled": 0,
"camera_discovery_enabled": 0,
"stream_link_enabled": 0,
"media_enabled": 0,
"billing_enabled": 0
}
JSON
)
echo "Gateway UUID: $GATEWAY_UUID"
echo "Agent name: $AGENT_NAME"
echo "Endpoint: $GUARD_URL/api/gateway/mini-pc/heartbeat"
echo ""
curl -k -sS \
-H "Content-Type: application/json" \
-X POST "$GUARD_URL/api/gateway/mini-pc/heartbeat" \
--data "$PAYLOAD"
echo ""
echo "M9.4 manual heartbeat sent."