From 216893008994475c00e598f5337020313f40109e Mon Sep 17 00:00:00 2001 From: Alin Nastac Date: Thu, 11 Jul 2019 13:13:07 +0200 Subject: [PATCH] net-snmp: reload firewall only when needed Firewall needs to be reloaded in the following cases: - on service start when snmpd.general.enabled=1 - when snmpd daemon is stopped Signed-off-by: Alin Nastac --- net/net-snmp/files/snmpd.init | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/net-snmp/files/snmpd.init b/net/net-snmp/files/snmpd.init index 9ebcb491c..a7653176d 100644 --- a/net/net-snmp/files/snmpd.init +++ b/net/net-snmp/files/snmpd.init @@ -337,7 +337,8 @@ start_service() { } stop_service() { - [ -f "$CONFIGFILE" ] && rm -f "$CONFIGFILE" + [ -f "$CONFIGFILE" ] || return + rm -f "$CONFIGFILE" procd_set_config_changed firewall } @@ -353,5 +354,6 @@ service_triggers(){ } service_started() { + [ "$snmp_enabled" -eq 0 ] && return procd_set_config_changed firewall }