HEX
Server: Apache/2.4.63 (Unix)
System: Linux TOMS-220NAS 4.4.302+ #86009 SMP Wed Nov 26 18:19:17 CST 2025 x86_64
User: flavio87 (1026)
PHP: 8.3.27
Disabled: NONE
Upload Files
File: //usr/syno/lib/systemd/scripts/snmpd.sh
#!/bin/bash

gen_snmpd_arg() {
	local startArg="udp:127.0.0.1:161,tcp:127.0.0.1:161"

	local isEnable
	isEnable=$(/usr/syno/bin/synogetkeyvalue /etc/synoinfo.conf runsnmpd)
	if [ "$isEnable" == "yes" ]; then
		startArg="udp:161,udp6:161,tcp:161,tcp6:161"
	fi

	/usr/bin/echo "$startArg"
}

start() {
	local startArg
	startArg=$(gen_snmpd_arg)
	exec /usr/bin/snmpd -fLn -c /etc/snmp/snmpd.conf -p /var/run/snmpd.pid "${startArg}"
}

start
# NOTE: Because of running exec in start function, the lines below should not be run
exit 1