mirror of
https://github.com/bettercap/bettercap
synced 2025-07-16 10:03:39 -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
|
@ -286,7 +286,7 @@ func ActivateInterface(name string) error {
|
|||
|
||||
func SetInterfaceTxPower(name string, txpower int) error {
|
||||
if core.HasBinary("iwconfig") {
|
||||
if out, err := core.ExecSilent("iwconfig", []string{name, "txpower", fmt.Sprintf("%d", txpower)}); err != nil {
|
||||
if out, err := core.Exec("iwconfig", []string{name, "txpower", fmt.Sprintf("%d", txpower)}); err != nil {
|
||||
return err
|
||||
} else if out != "" {
|
||||
return fmt.Errorf("unexpected output while setting txpower to %d for interface %s: %s", txpower, name, out)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue