- Create a new script called NetLock RMM Agent upgrade script.
- Paste the following code, OR (pro tip) look it up in the community scripts:
#!/bin/bash
set -e
INSTALLER_URL="https://netlockrmm.com/downloads/NetLock_RMM_Agent_Installer_linux_x64"
INSTALLER_DIR="/tmp/netlock rmm/installer"
INSTALLER_PATH="$INSTALLER_DIR/NetLock_RMM_Agent_Installer"
SERVICE_FILE="/etc/systemd/system/netlock-rmm-agent-installer.service"
LOG_FILE="/var/log/netlock-rmm-agent-installer.log"
CONFIG_FILE="/var/0x101 Cyber Security/NetLock RMM/Comm Agent/server_config.json"
echo "[*] Create target directory: $INSTALLER_DIR"
mkdir -p "$INSTALLER_DIR"
echo "[*] Download installer from $INSTALLER_URL..."
curl -fsSL -A "Mozilla/5.0" "$INSTALLER_URL" -o "$INSTALLER_PATH"
echo "[*] Set execution rights for installers..."
chmod +x "$INSTALLER_PATH"
echo "[*] Create systemd service file..."
cat <<EOF > "$SERVICE_FILE"
[Unit]
Description=netlock-rmm-agent-installer
After=network.target
[Service]
ExecStart="$INSTALLER_PATH" "fix" "$CONFIG_FILE"
Restart=no
RestartSec=5s
User=root
WorkingDirectory=$INSTALLER_DIR
KillSignal=SIGINT
StandardOutput=append:$LOG_FILE
StandardError=append:$LOG_FILE
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
EOF
echo "[*] Set file permissions to $SERVICE_FILE..."
chmod 644 "$SERVICE_FILE"
echo "[*] Reload systemd daemon..."
systemctl daemon-reload
echo "[*] Start installer service to trigger update..."
systemctl start netlock-rmm-agent-installer
echo "Done."
- Select the device in the device overview.
- Execute the script with the remote shell.
- Done. It might be required to grant authorization again. After around ten minutes you should see the new version popping up.
- Create a new script called NetLock RMM Agent upgrade script.
- Paste the following code, OR (pro tip) look it up in the community scripts:
#!/bin/bash
# NetLock RMM Agent Installer macOS LaunchDaemon Setup
set -e
INSTALLER_URL="https://netlockrmm.com/downloads/NetLock_RMM_Agent_Installer_macos_x64"
INSTALLER_DIR="/tmp/netlock rmm/installer"
EXECUTABLE="$INSTALLER_DIR/NetLock_RMM_Agent_Installer"
PLIST_PATH="/Library/LaunchDaemons/com.netlock.rmm.installer.plist"
ARG1="fix"
ARG2="/var/0x101 Cyber Security/NetLock RMM/Comm Agent/server_config.json"
LOG_PATH="/var/log/netlock_rmm_installer.log"
ERROR_LOG_PATH="/var/log/netlock_rmm_installer_error.log"
# Check if script is executed as root
if [[ $EUID -ne 0 ]]; then
echo "This script must be executed as root! (sudo $0)"
exit 1
fi
# 0. Create installer directory
echo "[*] Create installer directory: $INSTALLER_DIR"
mkdir -p "$INSTALLER_DIR"
# 1. Download installer
echo "[*] Downloading installer from $INSTALLER_URL..."
curl -fsSL -A "Mozilla/5.0" "$INSTALLER_URL" -o "$EXECUTABLE"
# 2. Set permissions for executable
echo "[*] Set executable permissions..."
chmod +x "$EXECUTABLE"
# 3. Create LaunchDaemon plist file
echo "[*] Creating LaunchDaemon Plist at $PLIST_PATH..."
cat <<EOF > "$PLIST_PATH"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.netlock.rmm.installer</string>
<key>ProgramArguments</key>
<array>
<string>$EXECUTABLE</string>
<string>$ARG1</string>
<string>$ARG2</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
<key>StandardOutPath</key>
<string>$LOG_PATH</string>
<key>StandardErrorPath</key>
<string>$ERROR_LOG_PATH</string>
</dict>
</plist>
EOF
# 4. Set plist permissions
echo "[*] Setting permissions for plist..."
chmod 644 "$PLIST_PATH"
chown root:wheel "$PLIST_PATH"
# 5. Load LaunchDaemon
echo "[*] Loading LaunchDaemon..."
launchctl load -w "$PLIST_PATH"
echo "Done."
- Select the device in the device overview.
- Execute the script with the remote shell.
- Done. It might be required to grant authorization again. After around ten minutes you should see the new version popping up.