E
E
Ethan Reed2021-08-22 12:17:35
WiFi
Ethan Reed, 2021-08-22 12:17:35

Script to scan wifi network and write values ​​to file?

a script is required that scans the wifi network and then writes the value to a file from which I can read the values ​​​​with another script and, if the ssid matches, execute the script to reconnect.
got to the point that this script was written
/interface wireless scan safe-file=wlan wlan1
the problem is that I do not understand how to interrupt this scan. probyval delay but, in vain.
need help....

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Ethan Reed, 2021-08-27
@Elpida

As a result: it was not possible to solve the problem through scanning. did it differently.
added a telegram bot through a script to the scheduler, link - https://habr.com/ru/post/314108/
in /scripts left a script to switch to the access point that the phone distributes
in netwatch put the script down to switch to the home access point.
what do we get as a result?
when the bot sent a telegram the name of the script, the mikrotik switched to wifi which I distribute from the phone,
if I leave the visibility zone of the mikrotik, then it switches via netwath via pings according to the script to down to wifi at home.
ps It was not possible to implement the plan, but at least there is nothing to do. also via telegram you can send a command to mikrotik to switch to home wifi

K
Karpion, 2021-08-22
@Karpion

Read the manual for the team. For example, on Linux/FreeBSD, ping has an infinite loop by default, but you can specify a number of iterations.
And you don't have to write it to a file. Use a pipeline like In this case, it is possible and not necessary to interrupt the scan. first_command | second command

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question