Natives Unraid-Plugin: 21 Docker-, Netzwerk- und System-Tools als MCP-Server (Streamable HTTP) auf Port 3002. - mcp/server.php: MCP-Server (JSON-RPC 2.0, Streamable HTTP) - mcp/helpers.php: Lokale Tool-Implementierungen (kein SSH) - mcp/tools.php: 21 Tool-Definitionen - mcp/selftest.php: Selftest (12 Checks) - scripts/unraid-docker-mcp-helper.php: Write-Operationen - scripts/mua.service: systemd-Service - scripts/install.sh, update.sh, remove.sh: Plugin-Scripts - MUA.plg: Plugin-Manifest
43 lines
1.1 KiB
Bash
43 lines
1.1 KiB
Bash
#!/bin/bash
|
|
# MUA - Mikes Unraid Agent
|
|
# Update-Script
|
|
# Wird vom Unraid-Plugin-Installer bei Updates aufgerufen.
|
|
|
|
set -e
|
|
|
|
PLUGIN_DIR="/usr/local/plugins/mua"
|
|
SERVICE_FILE="$PLUGIN_DIR/scripts/mua.service"
|
|
HELPER_SRC="$PLUGIN_DIR/scripts/unraid-docker-mcp-helper.php"
|
|
HELPER_DST="/usr/local/bin/unraid-docker-mcp-helper.php"
|
|
|
|
echo "=== MUA Update ==="
|
|
|
|
# 1. PHP-Helper aktualisieren
|
|
if [ -f "$HELPER_SRC" ]; then
|
|
cp "$HELPER_SRC" "$HELPER_DST"
|
|
chmod 755 "$HELPER_DST"
|
|
echo " Helper aktualisiert"
|
|
fi
|
|
|
|
# 2. systemd-Service aktualisieren
|
|
if [ -f "$SERVICE_FILE" ]; then
|
|
cp "$SERVICE_FILE" /etc/systemd/system/mua.service
|
|
chmod 644 /etc/systemd/system/mua.service
|
|
systemctl daemon-reload
|
|
echo " Service aktualisiert"
|
|
fi
|
|
|
|
# 3. Service neu starten
|
|
systemctl restart mua.service
|
|
|
|
# 4. Health-Check
|
|
sleep 2
|
|
if curl -sf "http://127.0.0.1:3002/health" > /dev/null 2>&1; then
|
|
echo " Health-Check: OK"
|
|
echo "=== MUA aktualisiert ==="
|
|
else
|
|
echo " WARNUNG: Health-Check fehlgeschlagen"
|
|
systemctl status mua.service --no-pager || true
|
|
exit 1
|
|
fi
|