mirror of
https://github.com/bettercap/bettercap
synced 2025-07-06 13:02:12 -07:00
Merge pull request #1008 from jansramek/master
Fix getting of possible channels (darwin) #998
This commit is contained in:
commit
ee35550f70
1 changed files with 2 additions and 1 deletions
|
@ -41,7 +41,8 @@ func getFrequenciesFromChannels(output string) ([]int, error) {
|
||||||
if output != "" {
|
if output != "" {
|
||||||
if matches := WiFiChannelParser.FindStringSubmatch(output); len(matches) == 2 {
|
if matches := WiFiChannelParser.FindStringSubmatch(output); len(matches) == 2 {
|
||||||
for _, channel := range str.Comma(matches[1]) {
|
for _, channel := range str.Comma(matches[1]) {
|
||||||
if channel, err := strconv.Atoi(channel); err == nil {
|
re := regexp.MustCompile(`\d+`)
|
||||||
|
if channel, err := strconv.Atoi(re.FindString(channel)); err == nil {
|
||||||
freqs = append(freqs, Dot11Chan2Freq(channel))
|
freqs = append(freqs, Dot11Chan2Freq(channel))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue