#!/bin/bash # RMM Agent Linux Installation Script set -e echo "==> Installing RMM Agent Linux" # Check if running as root if [[ $EUID -ne 0 ]]; then echo "This script must be run as root" exit 1 fi # Create directories mkdir -p /etc/rmm mkdir -p /usr/local/bin # Copy binary if [ ! -f "rmm-agent-linux" ]; then echo "Error: rmm-agent-linux binary not found in current directory" exit 1 fi cp rmm-agent-linux /usr/local/bin/rmm-agent-linux chmod +x /usr/local/bin/rmm-agent-linux # Copy service file cp rmm-agent-linux.service /etc/systemd/system/ # Create example config if it doesn't exist if [ ! -f "/etc/rmm/config.yaml" ]; then cp config.yaml.example /etc/rmm/config.yaml echo "==> Created /etc/rmm/config.yaml - please edit with your backend URL and API key" fi # Reload systemd and enable service systemctl daemon-reload systemctl enable rmm-agent-linux echo "==> Installation complete!" echo "" echo "Next steps:" echo "1. Edit /etc/rmm/config.yaml with your backend URL and API key" echo "2. Start the service: systemctl start rmm-agent-linux" echo "3. Check status: systemctl status rmm-agent-linux" echo "4. View logs: journalctl -u rmm-agent-linux -f"