1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Do no create ipset if there is no empty for a protocol

This commit is contained in:
Ycarus (Yannick Chabanois) 2023-05-28 07:51:38 +02:00
parent b80d40f5ec
commit 88e16d51f1

View file

@ -495,11 +495,12 @@ _bypass_proto_without_ndpi() {
[ -z "$intf" ] && intf="all"
[ -z "$proto" ] && return
if [ "$(uci -q get openmptcprouter.settings.ndpi)" == "0" ] || [ "$ndpi" == "0" ]; then
ALLIPS=$(sqlite3 /usr/share/omr-bypass/omr-bypass.db "select ip from ipproto where proto=\"$proto\";" ".exit")
if [ -n "$ALLIPS" ]; then
ipset -q flush bypass_$proto > /dev/null 2>&1
ipset -q --exist restore <<-EOF
create bypass_$proto hash:net hashsize 64
EOF
ALLIPS=$(sqlite3 /usr/share/omr-bypass/omr-bypass.db "select ip from ipproto where proto='"$proto"';" ".exit")
for ip in $ALLIPS; do
ipset -q add bypass_$proto $ip
done
@ -539,6 +540,7 @@ _bypass_proto_without_ndpi() {
fi
fi
fi
fi
# Use dnsmasq ipset to bypass domains of the proto
local domains
#domains="$(cat /proc/net/xt_ndpi/host_proto | grep -i $proto: | sed -e "s/$proto://i" -e 's/*//' -e 's/,/ /g')"