mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 18:57:17 -07:00
fix: make macOS ALTQ and firewall related messages silent (fixes #162)
This commit is contained in:
parent
c570319d66
commit
68167b3f7c
2 changed files with 22 additions and 9 deletions
14
core/core.go
14
core/core.go
|
@ -41,6 +41,20 @@ func UniqueInts(a []int, sorted bool) []int {
|
|||
return uniq
|
||||
}
|
||||
|
||||
func ExecSilent(executable string, args []string) (string, error) {
|
||||
path, err := exec.LookPath(executable)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
raw, err := exec.Command(path, args...).CombinedOutput()
|
||||
if err != nil {
|
||||
return "", err
|
||||
} else {
|
||||
return Trim(string(raw)), nil
|
||||
}
|
||||
}
|
||||
|
||||
func Exec(executable string, args []string) (string, error) {
|
||||
path, err := exec.LookPath(executable)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue