fix check status of ufw

there is "active" in "inactive" word so we should check the whole word with -w switch in grep
This commit is contained in:
Amirali Sabouri 2025-01-06 21:19:04 +03:30 committed by GitHub
parent 463c0fe379
commit da09fcea46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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"