Add Go agent OpenWrt service package

This commit is contained in:
benya
2026-06-05 13:54:43 +03:00
parent 3e20beb7f3
commit ca8b001991
7 changed files with 165 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
SERVER_URL="http://127.0.0.1:8080"
ENROLLMENT_TOKEN="dev-enroll-token"
INTERVAL_SECONDS="30"
CHECK_TARGETS="1.1.1.1 8.8.8.8"
TUNNEL_IDENTITY_FILE="/etc/rmm-agent/tunnel_key"
LOCK_FILE="/tmp/rmm-agent-go.lock"
SPOOL_DIR="/tmp/rmm-agent-go-results"
BACKUP_DIR="/tmp/rmm-agent-go-backups"
TUNNEL_STATE_DIR="/tmp/rmm-agent-go-tunnels"
HOSTNAME_SUFFIX="-go"
DEVICE_ID=""
DEVICE_TOKEN=""

View File

@@ -0,0 +1,23 @@
#!/bin/sh /etc/rc.common
START=95
STOP=10
USE_PROCD=1
PROG=/usr/bin/rmm-agent-go
CONFIG_FILE=/etc/rmm-agent-go.conf
start_service() {
procd_open_instance
procd_set_param command "$PROG" -config "$CONFIG_FILE"
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param term_timeout 15
procd_set_param respawn 3600 5 5
procd_close_instance
}
stop_service() {
service_stop "$PROG"
rm -rf /tmp/rmm-agent-go.lock
}