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:
parent
b80d40f5ec
commit
88e16d51f1
1 changed files with 43 additions and 41 deletions
|
@ -495,11 +495,12 @@ _bypass_proto_without_ndpi() {
|
||||||
[ -z "$intf" ] && intf="all"
|
[ -z "$intf" ] && intf="all"
|
||||||
[ -z "$proto" ] && return
|
[ -z "$proto" ] && return
|
||||||
if [ "$(uci -q get openmptcprouter.settings.ndpi)" == "0" ] || [ "$ndpi" == "0" ]; then
|
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 flush bypass_$proto > /dev/null 2>&1
|
||||||
ipset -q --exist restore <<-EOF
|
ipset -q --exist restore <<-EOF
|
||||||
create bypass_$proto hash:net hashsize 64
|
create bypass_$proto hash:net hashsize 64
|
||||||
EOF
|
EOF
|
||||||
ALLIPS=$(sqlite3 /usr/share/omr-bypass/omr-bypass.db "select ip from ipproto where proto='"$proto"';" ".exit")
|
|
||||||
for ip in $ALLIPS; do
|
for ip in $ALLIPS; do
|
||||||
ipset -q add bypass_$proto $ip
|
ipset -q add bypass_$proto $ip
|
||||||
done
|
done
|
||||||
|
@ -539,6 +540,7 @@ _bypass_proto_without_ndpi() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
# Use dnsmasq ipset to bypass domains of the proto
|
# Use dnsmasq ipset to bypass domains of the proto
|
||||||
local domains
|
local domains
|
||||||
#domains="$(cat /proc/net/xt_ndpi/host_proto | grep -i $proto: | sed -e "s/$proto://i" -e 's/*//' -e 's/,/ /g')"
|
#domains="$(cat /proc/net/xt_ndpi/host_proto | grep -i $proto: | sed -e "s/$proto://i" -e 's/*//' -e 's/,/ /g')"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue