Add Go agent OpenWrt service package
This commit is contained in:
12
agent/openwrt/rmm-agent-go.conf
Normal file
12
agent/openwrt/rmm-agent-go.conf
Normal 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=""
|
||||
23
agent/openwrt/rmm-agent-go.init
Normal file
23
agent/openwrt/rmm-agent-go.init
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user