aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/omcproxy/files
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2018-12-29 15:56:39 +0100
committerHans Dedecker <dedeckeh@gmail.com>2018-12-29 16:08:31 +0100
commitd405edb481bb08ee5db482142c65064902899bd3 (patch)
tree09605ed0173175db58d9dd620a9f7d0e04c0a9ba /package/network/services/omcproxy/files
parentdf8f8bad082ea5280c19c9091c099b28b7e2fc67 (diff)
downloadupstream-d405edb481bb08ee5db482142c65064902899bd3.tar.gz
upstream-d405edb481bb08ee5db482142c65064902899bd3.tar.bz2
upstream-d405edb481bb08ee5db482142c65064902899bd3.zip
omcproxy: optimize interface triggers
Before installing an interface triggger check if an interface trigger for the interface is already in place. This avoids installing identical interface triggers for a given interface Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'package/network/services/omcproxy/files')
-rw-r--r--package/network/services/omcproxy/files/omcproxy.init13
1 files changed, 12 insertions, 1 deletions
diff --git a/package/network/services/omcproxy/files/omcproxy.init b/package/network/services/omcproxy/files/omcproxy.init
index 30816e34fd..757b7794ef 100644
--- a/package/network/services/omcproxy/files/omcproxy.init
+++ b/package/network/services/omcproxy/files/omcproxy.init
@@ -51,7 +51,16 @@ omcproxy_add_network_triggers() {
config_get downlinks $1 downlink
for link in $uplink $downlinks; do
- procd_add_interface_trigger "interface.*" $link /etc/init.d/omcproxy restart
+ local duplicate=0
+
+ for l in $LINKS; do
+ [ "$l" = "$link" ] && duplicate=1
+ done
+
+ [ "$duplicate" = 0 ] && {
+ LINKS="$LINKS $link"
+ procd_add_interface_trigger "interface.*" $link /etc/init.d/omcproxy restart
+ }
done
}
@@ -114,6 +123,8 @@ omcproxy_add_firewall_rules() {
}
service_triggers() {
+ LINKS=""
+
procd_add_reload_trigger "omcproxy"
config_foreach omcproxy_add_network_triggers proxy
}