https-dns-proxy: bugfix: correct PROCD firewall object

Signed-off-by: Stan Grishin <stangri@melmac.net>
This commit is contained in:
Stan Grishin
2021-03-25 22:55:33 +00:00
committed by Rosen Penev
parent e7caf1f2ba
commit 84fc5dfad4
3 changed files with 47 additions and 14 deletions

View File

@@ -111,23 +111,23 @@ start_service() {
json_add_array firewall
for c in $forceDNSPorts; do
if netstat -tuln | grep LISTEN | grep ":${c}" >/dev/null 2>&1; then
json_add_object ''
json_add_string type 'redirect'
json_add_string target 'DNAT'
json_add_string src 'lan'
json_add_string proto 'tcp udp'
json_add_object ""
json_add_string type redirect
json_add_string target DNAT
json_add_string src lan
json_add_string proto "tcp udp"
json_add_string src_dport "$c"
json_add_string dest_port "$c"
json_add_string reflection '0'
json_add_boolean reflection 0
json_close_object
else
json_add_object ''
json_add_string type 'rule'
json_add_string src 'lan'
json_add_string dest '*'
json_add_string proto 'tcp udp'
json_add_object ""
json_add_string type rule
json_add_string src lan
json_add_string dest "*"
json_add_string proto "tcp udp"
json_add_string dest_port "$c"
json_add_string target 'REJECT'
json_add_string target REJECT
json_close_object
fi
done