mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
fix: do not reset wifi channels if set before wifi module start
This commit is contained in:
parent
3a360e4622
commit
9ebd958218
1 changed files with 8 additions and 6 deletions
|
@ -651,13 +651,15 @@ func (mod *WiFiModule) Configure() error {
|
|||
mod.hopPeriod = time.Duration(hopPeriod) * time.Millisecond
|
||||
|
||||
if mod.source == "" {
|
||||
if freqs, err := network.GetSupportedFrequencies(ifName); err != nil {
|
||||
return fmt.Errorf("error while getting supported frequencies of %s: %s", ifName, err)
|
||||
} else {
|
||||
mod.setFrequencies(freqs)
|
||||
}
|
||||
if len(mod.frequencies) == 0 {
|
||||
if freqs, err := network.GetSupportedFrequencies(ifName); err != nil {
|
||||
return fmt.Errorf("error while getting supported frequencies of %s: %s", ifName, err)
|
||||
} else {
|
||||
mod.setFrequencies(freqs)
|
||||
}
|
||||
|
||||
mod.Debug("wifi supported frequencies: %v", mod.frequencies)
|
||||
mod.Debug("wifi supported frequencies: %v", mod.frequencies)
|
||||
}
|
||||
|
||||
// we need to start somewhere, this is just to check if
|
||||
// this OS supports switching channel programmatically.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue