mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -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
|
mod.hopPeriod = time.Duration(hopPeriod) * time.Millisecond
|
||||||
|
|
||||||
if mod.source == "" {
|
if mod.source == "" {
|
||||||
if freqs, err := network.GetSupportedFrequencies(ifName); err != nil {
|
if len(mod.frequencies) == 0 {
|
||||||
return fmt.Errorf("error while getting supported frequencies of %s: %s", ifName, err)
|
if freqs, err := network.GetSupportedFrequencies(ifName); err != nil {
|
||||||
} else {
|
return fmt.Errorf("error while getting supported frequencies of %s: %s", ifName, err)
|
||||||
mod.setFrequencies(freqs)
|
} 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
|
// we need to start somewhere, this is just to check if
|
||||||
// this OS supports switching channel programmatically.
|
// this OS supports switching channel programmatically.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue