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}" \\
|
"${BACKEND_URL}/api/v1/installer/download?platform=freebsd&api_key=${API_KEY}" \\
|
||||||
&& cd /tmp && unzip -o installer.zip && sh /tmp/install.sh`
|
&& cd /tmp && unzip -o installer.zip && sh /tmp/install.sh`
|
||||||
|
|
||||||
const linuxInstallCmd = `#!/bin/sh
|
const linuxInstallCmd = `#!/bin/bash
|
||||||
# RMM Agent + Updater Installation
|
# RMM Agent Linux Installer
|
||||||
|
# Als root ausfuehren: bash install.sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
BACKEND="${BACKEND_URL}"
|
BACKEND="${BACKEND_URL}"
|
||||||
API_KEY="${API_KEY}"
|
API_KEY="${API_KEY}"
|
||||||
NAME="${agentName || '<NAME>'}"
|
AGENT_NAME="${agentName || '<NAME>'}"
|
||||||
|
|
||||||
# Download
|
# Installer-ZIP herunterladen
|
||||||
wget --no-check-certificate -O /tmp/rmm-bundle.zip \\
|
wget --no-check-certificate -O /tmp/rmm-installer.zip \\
|
||||||
"$BACKEND/api/v1/firmware/download?platform=linux&api_key=$API_KEY"
|
"$BACKEND/api/v1/installer/download?platform=linux&api_key=$API_KEY"
|
||||||
cd /tmp && unzip -o rmm-bundle.zip
|
|
||||||
|
|
||||||
# Install binaries
|
# Entpacken und ausfuehren
|
||||||
install -m 755 /tmp/rmm-agent-linux /usr/local/bin/rmm-agent
|
cd /tmp && unzip -o rmm-installer.zip
|
||||||
install -m 755 /tmp/rmm-updater-linux /usr/local/bin/rmm-updater
|
|
||||||
mkdir -p /etc/rmm
|
|
||||||
|
|
||||||
# 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
|
cat > /etc/rmm/config.yaml << EOF
|
||||||
backend_url: "$BACKEND"
|
backend_url: "$BACKEND"
|
||||||
api_key: "$API_KEY"
|
api_key: "$API_KEY"
|
||||||
agent_name: "$NAME"
|
agent_name: "$AGENT_NAME"
|
||||||
interval_seconds: 60
|
interval_seconds: 60
|
||||||
insecure: true
|
insecure: true
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Systemd services
|
systemctl restart rmm-agent rmm-updater 2>/dev/null || systemctl start rmm-agent
|
||||||
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
|
|
||||||
echo "Fertig! Agent verbindet sich automatisch mit Backend."
|
echo "Fertig! Agent verbindet sich automatisch mit Backend."
|
||||||
`
|
`
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user