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 <alin.nastac@gmail.com>
This commit is contained in:
Alin Nastac 2019-07-11 13:13:07 +02:00 committed by Alin Nastac
parent b810b6f00e
commit 2168930089
1 changed files with 3 additions and 1 deletions

View File

@ -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
}