mirror of
https://github.com/bettercap/bettercap
synced 2025-07-30 19:50:06 -07:00
fix: gracefully handling wifi device disconnection
This commit is contained in:
parent
54116f7fbe
commit
afe300cd8a
4 changed files with 53 additions and 22 deletions
11
core/core.go
11
core/core.go
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"sort"
|
||||
|
||||
|
@ -34,7 +33,7 @@ func HasBinary(executable string) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
func ExecSilent(executable string, args []string) (string, error) {
|
||||
func Exec(executable string, args []string) (string, error) {
|
||||
path, err := exec.LookPath(executable)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
@ -47,11 +46,3 @@ func ExecSilent(executable string, args []string) (string, error) {
|
|||
return str.Trim(string(raw)), nil
|
||||
}
|
||||
}
|
||||
|
||||
func Exec(executable string, args []string) (string, error) {
|
||||
out, err := ExecSilent(executable, args)
|
||||
if err != nil {
|
||||
fmt.Printf("ERROR for '%s %s': %s\n", executable, args, err)
|
||||
}
|
||||
return out, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue