From 3c19033e717e1fc5a1db1cb36c15568aa2aacd1c Mon Sep 17 00:00:00 2001 From: ivacom Date: Tue, 17 Mar 2026 07:47:24 +0000 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20install-agent.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install-agent.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 install-agent.sh diff --git a/install-agent.sh b/install-agent.sh new file mode 100644 index 0000000..057a7e8 --- /dev/null +++ b/install-agent.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# MTG Agent installer / updater +# Usage: bash install-agent.sh [AGENT_TOKEN] +set -e + +TOKEN="${1:-mtg-agent-secret}" +INSTALL_DIR="/opt/mtg-agent" +RAW="https://raw.githubusercontent.com/MaksimTMB/mtg-adminpanel/dev/mtg-agent" + +echo "==> MTG Agent install/update..." +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" \ No newline at end of file