fix: Linux Installationsanleitung auf /installer/download Endpoint und install-linux.sh umgestellt
This commit is contained in:
parent
ae1a8617f5
commit
a0fb6b465f
@ -54,62 +54,40 @@ export default function InstallGuide({ agentName, platform: initialPlatform }) {
|
||||
"${BACKEND_URL}/api/v1/installer/download?platform=freebsd&api_key=${API_KEY}" \\
|
||||
&& cd /tmp && unzip -o installer.zip && sh /tmp/install.sh`
|
||||
|
||||
const linuxInstallCmd = `#!/bin/sh
|
||||
# RMM Agent + Updater Installation
|
||||
const linuxInstallCmd = `#!/bin/bash
|
||||
# RMM Agent Linux Installer
|
||||
# Als root ausfuehren: bash install.sh
|
||||
set -e
|
||||
|
||||
BACKEND="${BACKEND_URL}"
|
||||
API_KEY="${API_KEY}"
|
||||
NAME="${agentName || '<NAME>'}"
|
||||
AGENT_NAME="${agentName || '<NAME>'}"
|
||||
|
||||
# Download
|
||||
wget --no-check-certificate -O /tmp/rmm-bundle.zip \\
|
||||
"$BACKEND/api/v1/firmware/download?platform=linux&api_key=$API_KEY"
|
||||
cd /tmp && unzip -o rmm-bundle.zip
|
||||
# Installer-ZIP herunterladen
|
||||
wget --no-check-certificate -O /tmp/rmm-installer.zip \\
|
||||
"$BACKEND/api/v1/installer/download?platform=linux&api_key=$API_KEY"
|
||||
|
||||
# Install binaries
|
||||
install -m 755 /tmp/rmm-agent-linux /usr/local/bin/rmm-agent
|
||||
install -m 755 /tmp/rmm-updater-linux /usr/local/bin/rmm-updater
|
||||
mkdir -p /etc/rmm
|
||||
# Entpacken und ausfuehren
|
||||
cd /tmp && unzip -o rmm-installer.zip
|
||||
|
||||
# Config
|
||||
# Config mit korrekten Werten vorbelegen
|
||||
export RMM_BACKEND_URL="$BACKEND"
|
||||
export RMM_API_KEY="$API_KEY"
|
||||
export RMM_AGENT_NAME="$AGENT_NAME"
|
||||
|
||||
# Installationsskript ausfuehren
|
||||
bash /tmp/install-linux.sh
|
||||
|
||||
# Config mit den richtigen Werten ueberschreiben
|
||||
cat > /etc/rmm/config.yaml << EOF
|
||||
backend_url: "$BACKEND"
|
||||
api_key: "$API_KEY"
|
||||
agent_name: "$NAME"
|
||||
agent_name: "$AGENT_NAME"
|
||||
interval_seconds: 60
|
||||
insecure: true
|
||||
EOF
|
||||
|
||||
# Systemd services
|
||||
cat > /etc/systemd/system/rmm-agent.service << EOF
|
||||
[Unit]
|
||||
Description=RMM Agent
|
||||
After=network.target
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/local/bin/rmm-agent
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
cat > /etc/systemd/system/rmm-updater.service << EOF
|
||||
[Unit]
|
||||
Description=RMM Updater
|
||||
After=network.target
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/local/bin/rmm-updater
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now rmm-agent rmm-updater
|
||||
systemctl restart rmm-agent rmm-updater 2>/dev/null || systemctl start rmm-agent
|
||||
echo "Fertig! Agent verbindet sich automatisch mit Backend."
|
||||
`
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user