From 191f0ef0eff2f45d37b221f9753982d3d8b5182c Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Fri, 12 Jul 2024 16:20:58 +0800 Subject: [PATCH] fix(fw/pre): fix open server port Signed-off-by: Tianling Shen --- root/etc/homeproxy/scripts/firewall_pre.ut | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/root/etc/homeproxy/scripts/firewall_pre.ut b/root/etc/homeproxy/scripts/firewall_pre.ut index 1f8475a7..f53addd3 100755 --- a/root/etc/homeproxy/scripts/firewall_pre.ut +++ b/root/etc/homeproxy/scripts/firewall_pre.ut @@ -40,14 +40,15 @@ chain input { iifname {{ tun_name }} counter accept comment "!{{ cfgname }}: accept tun input" {% endif %} {% - uci.foreach(cfgname, 'server', (s) => { - if (s.enabled !== '1') - return; - - let proto = s.network || '{ tcp, udp }'; - printf(' meta l4proto %s th dport %s counter accept comment "!%s: accept server %s"\n', - proto, s.port, cfgname, s['.name']); - }); + if (auto_firewall === '1') + uci.foreach(cfgname, 'server', (s) => { + if (s.enabled !== '1') + return; + + let proto = s.network || '{ tcp, udp }'; + printf(' meta l4proto %s th dport %s counter accept comment "!%s: accept server %s"\n', + proto, s.port, cfgname, s['.name']); + }); %} } {% endif %}