mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 10:46:57 -07:00
new: wifi.recon will activate the interface if it's down instead of failing
This commit is contained in:
parent
3c798794eb
commit
003139a2e3
3 changed files with 55 additions and 24 deletions
|
@ -7,6 +7,8 @@ import (
|
|||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/bettercap/bettercap/core"
|
||||
|
||||
"github.com/evilsocket/islazy/data"
|
||||
"github.com/evilsocket/islazy/str"
|
||||
|
||||
|
@ -256,3 +258,12 @@ func FindInterface(name string) (*Endpoint, error) {
|
|||
|
||||
return nil, ErrNoIfaces
|
||||
}
|
||||
|
||||
func ActivateInterface(name string) error {
|
||||
if out, err := core.Exec("ifconfig", []string{name, "up"}); err != nil {
|
||||
return err
|
||||
} else if out != "" {
|
||||
return fmt.Errorf("unexpected output while activating interface %s: %s", name, out)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue