From da09fcea4606192f70a18e3d05ac197203657cf7 Mon Sep 17 00:00:00 2001 From: Amirali Sabouri Date: Mon, 6 Jan 2025 21:19:04 +0330 Subject: [PATCH] fix check status of ufw there is "active" in "inactive" word so we should check the whole word with -w switch in grep --- vps-audit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vps-audit.sh b/vps-audit.sh index c26f139..31101cb 100755 --- a/vps-audit.sh +++ b/vps-audit.sh @@ -166,7 +166,7 @@ fi # Check Firewall Status check_firewall_status() { if command -v ufw >/dev/null 2>&1; then - if ufw status | grep -q "active"; then + if ufw status | grep -qw "active"; then check_security "Firewall Status (UFW)" "PASS" "UFW firewall is active and protecting your system" else check_security "Firewall Status (UFW)" "FAIL" "UFW firewall is not active - your system is exposed to network attacks"