From 2660d8ad2ea8198ffd70514f1e550d7d1c418924 Mon Sep 17 00:00:00 2001 From: vdutta Date: Fri, 23 Sep 2022 18:23:51 +0530 Subject: [PATCH] twamp: 1.2.2 --- twamp/Makefile | 2 +- twamp/files/etc/firewall.twamp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/twamp/Makefile b/twamp/Makefile index aaba20bc1..575479aec 100755 --- a/twamp/Makefile +++ b/twamp/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=twamp -PKG_VERSION:=1.2.1 +PKG_VERSION:=1.2.2 LOCAL_DEV:=0 ifneq ($(LOCAL_DEV),1) diff --git a/twamp/files/etc/firewall.twamp b/twamp/files/etc/firewall.twamp index 807833743..db5532d2f 100644 --- a/twamp/files/etc/firewall.twamp +++ b/twamp/files/etc/firewall.twamp @@ -29,8 +29,11 @@ function configure_firewall() function delete_rule() { - while iptables -w 1 -L zone_${1}_input --line-numbers | grep "TWAMP reflector port" > /dev/null 2>&1; do - iptables -w 1 -D zone_${1}_input $(iptables -w 1 -L zone_${1}_input --line-numbers | grep "TWAMP reflector port" | head -1|awk '{print $1}'); + while iptables -w 1 -L zone_${1}_input --line-numbers 2>/dev/null | grep "TWAMP reflector port"; do + rule_num="$(iptables -w 1 -L zone_${1}_input --line-numbers | grep "TWAMP reflector port" | head -1|awk '{print $1}')" + if [ -n "${rule_num}" ]; then + iptables -w 1 -D zone_${1}_input ${rule_num}; + fi done }