I'm trying to create a script for my mAP lite, so that it's easier to bring on my travels to different locations. I want a script that runs at startup, which scans all available networks in the area and matches them to my known networks(security profiles). If it finds a known network, set up the wireless station with the correct SSID and security profile. If it does not find a match, set up the master interface as an AP.
At the moment I've only managed to wireless in the area at startup. I'm not sure how to compare what I've found to any known networks.
Current script:
Code: Select all
#wait 15s after startup for wireless to be up
:delay 15;
#background scan wlan1 for 15 sec, save to scan.txt
:interface wireless scan duration=15 wlan1 background=yes save-file=scan.txt;
:log info "wireless scan complete";
#Put content of scan.txt into ScanContents variable:
:global ScanContents [/file get scan.txt contents];
Code: Select all
'(.+)'
At the moment I haven't found out how to use this for something useful.
Am I on the right path, is there a better way to do this?
I'm still pretty new to the mikrotik-world, so I appreciate all the help I can get!