From 4392d356cee62182ebb1144f780bc6bdc0612263 Mon Sep 17 00:00:00 2001 From: bol-van Date: Sat, 11 Dec 2021 11:11:07 +0300 Subject: [PATCH] init: clear qn variables when MODE_HTTP(s) disabled --- init.d/openwrt/functions | 14 ++++++++++---- init.d/sysv/functions | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/init.d/openwrt/functions b/init.d/openwrt/functions index c36ed25..2108ffa 100644 --- a/init.d/openwrt/functions +++ b/init.d/openwrt/functions @@ -353,14 +353,20 @@ get_nfqws_qnums() } [ "$NFQWS_OPT_DESYNC_HTTPS6" = "$NFQWS_OPT_DESYNC_HTTP6" ] && _qns6=$_qn6; } - [ "$MODE_HTTP" = 1 ] && { + if [ "$MODE_HTTP" = 1 ]; then eval $1=$_qn eval $3=$_qn6 - } - [ "$MODE_HTTPS" = 1 ] && { + else + eval $1= + eval $3= + fi + if [ "$MODE_HTTPS" = 1 ]; then eval $2=$_qns eval $4=$_qns6 - } + else + eval $2= + eval $4= + fi } create_ipset() diff --git a/init.d/sysv/functions b/init.d/sysv/functions index d3f46e2..0890d5b 100644 --- a/init.d/sysv/functions +++ b/init.d/sysv/functions @@ -580,14 +580,20 @@ get_nfqws_qnums() } [ "$NFQWS_OPT_DESYNC_HTTPS6" = "$NFQWS_OPT_DESYNC_HTTP6" ] && _qns6=$_qn6; } - [ "$MODE_HTTP" = 1 ] && { + if [ "$MODE_HTTP" = 1 ]; then eval $1=$_qn eval $3=$_qn6 - } - [ "$MODE_HTTPS" = 1 ] && { + else + eval $1= + eval $3= + fi + if [ "$MODE_HTTPS" = 1 ]; then eval $2=$_qns eval $4=$_qns6 - } + else + eval $2= + eval $4= + fi } tpws_apply_socks_binds()