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

Remove not needed iptables-save output

This commit is contained in:
Ycarus (Yannick Chabanois) 2022-09-24 10:17:37 +02:00
parent 25cdf439ca
commit ca45d952c2
11 changed files with 40 additions and 39 deletions

View file

@ -122,7 +122,7 @@ ss_rules_parse_args() {
ss_rules_flush() {
local setname
iptables-save --counters | grep -v ssr_ | iptables-restore -w --counters
iptables-save --counters 2>/dev/null | grep -v ssr_ | iptables-restore -w --counters
while ip rule del fwmark 1 lookup 100 2>/dev/null; do true; done
ip route flush table 100 || true
for setname in $(ipset -n list | grep "ssr_${rule}"); do
@ -187,7 +187,7 @@ ss_rules_iptchains_init_tcp() {
forward) local_target=ssr_${rule}_forward ;;
bypass|*) return 0;;
esac
if [ "$(iptables-save | grep ssr_${rule}_local_out | grep ssr_${rule}_dst_bypass)" = "" ]; then
if [ "$(iptables-save 2>/dev/null | grep ssr_${rule}_local_out | grep ssr_${rule}_dst_bypass)" = "" ]; then
iptables-restore -w --noflush <<-EOF
*nat
:ssr_${rule}_local_out -