fix: gracefully handling wifi device disconnection

This commit is contained in:
evilsocket 2019-03-30 16:17:26 +01:00
parent 54116f7fbe
commit afe300cd8a
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
4 changed files with 53 additions and 22 deletions

View file

@ -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)