Check AP-radio band usage script

Via via found this scipt, author unknown;

/system script
add name=“ChangeBand”
source=“:local delais 5s\r\n:local liste 2.4ghz-b/g,2ghz-5mhz,2ghz-10mhz;\r\n
\r\n:foreach band in=$liste
do={\r\n:if (![/interface wireless get wlan1 running]) do={\r\n/interface
wireless set wlan1 band=$band\r\n:delay $delais\r\n}\r\n}\r\n\r\n:if
(![/interface wireless get wlan1 running]) \\r\ndo={\r\n :if
[/interface wireless nstreme get wlan1 enable-nstreme] \\r\n do={\r\n
/interface wireless nstreme set wlan1 enable-nstreme=no\r\n }
else={\r\n /interface wireless nstreme set wlan1
enable-nstreme=yes\r\n }\r\n}”
/system scheduler
add comment=“” disabled=no interval=20s name=“schedcheckWifi”
on-event=ChangeBand start-time=startup

This would solve the problem of swapping channel bandwith for ALL clienst in access list of AP when AP is using other band while not all stations are reachable for manual editing just before…

But I am a no-know when it comes to scripts:
Can someone show me where I actually can cut in this script to get the nstreme part out?
And to use this script for 802.11a or 802.11a/n networks, how do I change the script’s first line for that?

Also, how can I identify if a script works in a certain ros family? I have seen many scripts not working after ros versions changed. I’d like to use this script in a ros4.16+ or v5rc10+ version router.
How can I tell if it works? I can’t just try, when it doesn’t I loose the connection and have to go to the remote unit, something I really would like to avoid.
I also don’t have sufficient time and devices on hand to make a lab setup to try out…

So, if the original author sees this and help me out, or anyone else, I can spare some carma points… :smiley:

I than also think this script can be so useful it should end up in the Wiki manual somewhere.