fix: returning error when neither iw or iwconfig are found

This commit is contained in:
Simone Margaritelli 2021-03-29 17:25:15 +02:00
commit c4bbc129b6

View file

@ -57,6 +57,8 @@ func SetInterfaceChannel(iface string, channel int) error {
} else if out != "" { } else if out != "" {
return fmt.Errorf("Unexpected output while setting interface %s to channel %d: %s", iface, channel, out) return fmt.Errorf("Unexpected output while setting interface %s to channel %d: %s", iface, channel, out)
} }
} else {
return fmt.Errorf("no iw or iwconfig binaries found in $PATH")
} }
SetInterfaceCurrentChannel(iface, channel) SetInterfaceCurrentChannel(iface, channel)