1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-14 19:41:51 +00:00

Fix omr-test-speed on 6.1/6.6 kernel with nft

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-04-03 10:16:52 +02:00
parent 00d3bc3119
commit 7c6429e611
2 changed files with 20 additions and 0 deletions

View file

@ -57,6 +57,11 @@ else
ipset add ss_rules_dst_bypass_all $ip
done
fi
if [ -n "$(nft list set inet fw4 omr_dst_bypass_all_4 2>/dev/null)" ]; then
for ip in $hostip; do
nft add element inet fw4 omr_dst_bypass_all_4 { $ip } 2>&1 >/dev/null
done
fi
if [ "$FASTTEST" = true ]; then
avg_speed=$(curl -4 --max-time 10 -o /dev/null -qfsS -w '%{speed_download}' --interface $INTERFACE $HOST 2>/dev/null)
echo "$avg_speed"
@ -68,5 +73,10 @@ else
ipset del ss_rules_dst_bypass_all $ip
done
fi
if [ -n "$(nft list set inet fw4 omr_dst_bypass_all_4 2>/dev/null)" ]; then
for ip in $hostip; do
nft delete element inet fw4 omr_dst_bypass_all_4 { $ip } 2>&1 >/dev/null
done
fi
/etc/init.d/sqm start $INTERFACE
fi

View file

@ -54,6 +54,11 @@ else
ipset add ss_rules6_dst_bypass_all $ip
done
fi
if [ -n "$(nft list set inet fw4 omr_dst_bypass_all_6 2>/dev/null)" ]; then
for ip in $hostip; do
nft add element inet fw4 omr_dst_bypass_all_6 { $ip } 2>&1 >/dev/null
done
fi
if [ "$FASTTEST" = true ]; then
avg_speed=$(curl -6 --max-time 10 -o /dev/null -qfsS -w '%{speed_download}' --interface $INTERFACE $HOST 2>/dev/null)
echo "$avg_speed"
@ -65,5 +70,10 @@ else
ipset del ss_rules6_dst_bypass_all $ip
done
fi
if [ -n "$(nft list set inet fw4 omr_dst_bypass_all_6 2>/dev/null)" ]; then
for ip in $hostip; do
nft delete element inet fw4 omr_dst_bypass_all_6 { $ip } 2>&1 >/dev/null
done
fi
/etc/init.d/sqm start $INTERFACE
fi