mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
6dd86c44fa
commit
0d17ba3573
2 changed files with 3 additions and 62 deletions
|
@ -69,12 +69,12 @@ var iwlistFreqParser = regexp.MustCompile(`^\s+Channel.([0-9]+)\s+:\s+([0-9\.]+)
|
|||
func iwlistSupportedFrequencies(iface string) ([]int, error) {
|
||||
out, err := core.Exec("iwlist", []string{iface, "freq"})
|
||||
if err != nil {
|
||||
return err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
freqs := make([]int, 0)
|
||||
if output != "" {
|
||||
scanner := bufio.NewScanner(strings.NewReader(output))
|
||||
if out != "" {
|
||||
scanner := bufio.NewScanner(strings.NewReader(out))
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
matches := iwlistFreqParser.FindStringSubmatch(line)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue