Dears,
I would like to check the hide-ssid value for around 3000 Mikrotik boards and write it in a file.
Is there any way to write a script for this purpose.
I tried a lot for the past week with :put command but couldn’t append to a file.
Regards,
Dears,
I would like to check the hide-ssid value for around 3000 Mikrotik boards and write it in a file.
Is there any way to write a script for this purpose.
I tried a lot for the past week with :put command but couldn’t append to a file.
Regards,
This ought to work
:local file “hiddenSSID.txt”
:local buffer
:local delim “\r”
:foreach ssid in=[/interface wireless find where hide-ssid] do={
:set $buffer ($buffer.[/interface wireless get $ssid ssid].$delim)
}
/file print file=$file
/file set [find name=“$file”] contents=$buffer
It is not working
I am copying the mentioned lines in the terminal but unfortunately getting no results and no file is being created.
Thank you for your help
regards,
Just tested it at work on a accesspoint, i hade to add a delay between the file creation and saving contents to the txt file but it works.
Tested on RouterOS v6.83.3
Try to run it as a script:
/system script
add name=hiddenSSID owner=admin policy=
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=“:local
file "hiddenSSID.txt"\r
\n:local buffer\r
\n:local delim "\r"\r
\n\r
\n:foreach ssid in=[/interface wireless find where hide-ssid] do={\r
\n:set $buffer ($buffer.[/interface wireless get $ssid ssid].$delim)\r
\n}\r
\n\r
\n/file print file=$file\r
\ndelay 1\r
\n/file set [find name="$file"] contents=$buffer”
/system run script hiddenSSID
When you made your changes you want to the script (system->scripts) you could copy it to a file and name it hiddenssid.auto.rsc for example and upload if by ftp to all your access points for it to run automatically.