Hi there,
I am trying to do the following in a script:
Do a wireless scan
Read the frequency and radio names
Perform some calculation
Connect to one of the APs detected above based on calculation result.
I’ve tried multiple ways and each of them come up short:
- doing a scan in the terminal gives me the exact results that I need, but I can’t figure out how to extract the output into a variable so that I can parse it in my script. Any tips would be greatly appreciated.
example output:
Flags: A - active, P - privacy, R - routeros-network, N - nstreme, T - tdma, W - w
ADDRESS SSID CHANNEL SIG NF SNR RADIO-N
AP 6C:19:8F:CC:1B:96 5200/20-eCee/ac -43 -102 59 6C3B6B… 6.37.1
AP A0:63:91:1D:6E:F6 NETGEAR68-5G 5220/20-eeCe/ac -87 -102 15
- doing a scan to file. This does not work as the save-file option does not save all of the information that is present in the normal scan and I need this information (the remote Mikrotik radio names specifically)
example output:
6C:19:8F:CC:1B:96,‘’,5200/20-eCee/ac,-43,802.11,privacy,
A0:63:91:1D:6E:F6,‘NETGEAR68-5G’,5220/20-eeCe/ac,-87,802.11,privacy,
- doing a scan in the terminal via ssh with output-to-file (so that I can capture the full output). This works fine when run from the terminal, but seems to be disabled for security reasons when run from a script.
Any help would be greatly appreciated