Files
ISCM_agent/install-agent.sh

23 lines
671 B
Bash
Raw Normal View History

2026-03-17 07:47:24 +00:00
#!/bin/bash
2026-03-17 07:54:13 +00:00
# ISCM Agent installer / updater
2026-03-17 07:47:24 +00:00
# Usage: bash install-agent.sh [AGENT_TOKEN]
set -e
2026-03-17 07:54:13 +00:00
TOKEN="${1:-agent-secret}"
INSTALL_DIR="/opt/iscm-agent"
RAW="https://git.ivacom.su/public/ISCM_agent/raw/branch/main"
2026-03-17 07:47:24 +00:00
2026-03-17 07:54:13 +00:00
echo "==> Iscm Agent install/update..."
2026-03-17 07:47:24 +00:00
mkdir -p "$INSTALL_DIR"
cd "$INSTALL_DIR"
curl -fsSL "$RAW/main.py" -o main.py
curl -fsSL "$RAW/docker-compose.yml" -o docker-compose.yml
echo "AGENT_TOKEN=${TOKEN}" > .env
docker compose down 2>/dev/null || true
docker compose up -d
echo "==> Done. Agent starting in background (pip install may take ~30s)"
echo "==> Check status: curl -s -H 'x-agent-token: ${TOKEN}' http://localhost:8081/health"