From ba9d56c88eab1598d62011852dea98b8e165dde1 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 25 Sep 2024 14:49:48 -0600 Subject: [PATCH] fix --- firewall.sh | 2 -- modules/module-rate-limit-web.sh | 9 +++------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/firewall.sh b/firewall.sh index 3762d43..3db7bc8 100755 --- a/firewall.sh +++ b/firewall.sh @@ -271,8 +271,6 @@ stop() { $NFT insert rule filter input iif lo accept $NFT -f /opt/firewall/ipv6-filter.nft - # $NFT add rule ip6 filter input icmpv6 type nd-neighbor-solicit accept - # $NFT add rule ip6 filter input icmpv6 type nd-router-advert accept message "Stopping Firewall" } diff --git a/modules/module-rate-limit-web.sh b/modules/module-rate-limit-web.sh index 5905d72..b447c6d 100644 --- a/modules/module-rate-limit-web.sh +++ b/modules/module-rate-limit-web.sh @@ -1,12 +1,9 @@ #!/bin/bash NFT='/usr/bin/nft' -HANDLE=($($NFT -n -a list ruleset | grep "ct state 0x8 tcp dport" | grep -E '80|443' | grep handle | cut -d '#' -f2 | cut -d ' ' -f3)) +HANDLE=($($NFT -a -n list ruleset | grep "ct state 0x8 tcp dport" | grep -E '80|443' | grep handle | cut -d '#' -f2 | cut -d ' ' -f3)) for i in "${HANDLE[@]}"; do - if [[ "$i" == *":"* ]]; then - $NFT delete rule ip6 filter input handle $i &>/dev/null - else - $NFT delete rule filter input handle $i &>/dev/null - fi + $NFT delete rule ip6 filter input handle $i &>/dev/null + $NFT delete rule ip filter input handle $i &>/dev/null done echo "Setting Rate Limit to : $1"