diff --git a/security/firewall.go b/security/firewall.go index ab8bdf3c..75e80a07 100644 --- a/security/firewall.go +++ b/security/firewall.go @@ -40,15 +40,14 @@ func FirewallStealthState() string { func firewallStateLinux() string { // might be very Ubuntu specific user, _ := user.Current() - - if (strings.Contains(user.Username, "root") { - cmd := exec.Command("ufw, "status") + + if strings.Contains(user.Username, "root") { + cmd := exec.Command("ufw", "status") + var o bytes.Buffer - cmd.Stdout = &o - if err := cmd.Run(); err != nil { - return "[red]NA[white] + return "[red]NA[white]" } if strings.Contains(o.String(), "active") { @@ -56,6 +55,8 @@ func firewallStateLinux() string { // might be very Ubuntu specific } else { return "[red]Disabled[white]" } + } else { + return "[red]NA[white]" } }