mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
only get linux firewall if root
This commit is contained in:
parent
7b422cc3f3
commit
c3baf05b20
@ -5,6 +5,7 @@ import (
|
||||
"runtime"
|
||||
"strings"
|
||||
"bytes"
|
||||
"os/user"
|
||||
|
||||
"github.com/senorprogrammer/wtf/wtf"
|
||||
)
|
||||
@ -38,6 +39,9 @@ func FirewallStealthState() string {
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
func firewallStateLinux() string { // might be very Ubuntu specific
|
||||
user, _ := user.Current()
|
||||
|
||||
if (strings.Contains(user.Username, "root") {
|
||||
cmd := exec.Command("ufw, "status")
|
||||
var o bytes.Buffer
|
||||
|
||||
@ -53,6 +57,7 @@ func firewallStateLinux() string { // might be very Ubuntu specific
|
||||
return "[red]Disabled[white]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func firewallStateMacOS() string {
|
||||
cmd := exec.Command(osxFirewallCmd, "--getglobalstate")
|
||||
|
Loading…
x
Reference in New Issue
Block a user