I created a script that adds mac address to the access list. My installers set the wireless mac to specific mac address. The AP then grabs the the radio name, which is the original mac, and adds that to the access list. This part works great. The installer will then reset the mac address and update the radio name to the customer name. The second part of the script then sets the comment in the access list to the radio name. The second part does work if I run the script from winbox or the scheduler. The script works from the terminal ( /system script run Auth ). This has been tested with RouterOS v6.? - 6.27.
/interface wireless access-list add mac-address=314159265358 interface=all comment=”AUTH”
/system scheduler add interval=5m name=AutoAuth on-event=Auth start-time=startup policy=ftp,password,policy,read,reboot,sensitive,sniff,test,write
/system script
add name=Auth policy=ftp,password,policy,read,reboot,sensitive,sniff,test,write \
source=":if ([:len [/interface wireless registration-table find where mac-address=31:41:59:26:53:58]]=1 and [:len [/interface wireless access-list find where comment=[/interface wireless registration-table get [find mac-address=31:41:59:26:53:58] value-name=radio-name ]]] =0 ) do={/interface wireless access-list add forwarding=no interface=all mac-address=[/interface wireless registration-table get [find mac-address=31:41:59:26:53:58] value-name=radio-name ] comment=[/interface wireless registration-table get [find mac-address=31:41:59:26:53:58] value-name=radio-name ]}\r\
\n:for i from=0 to=([/interface wireless registration-table print count-only ] -1 ) do={:if ([/interface wireless registration-table get \$i value-name=comment] != [/interface wireless registration-table get \$i value-name=radio-name ] and [/interface wireless registration-table get \$i value-name=mac-address] != \"31:41:59:26:53:58\" ) do={/interface wireless access-list set [find mac-address=[/interface wireless registration-table get \$i value-name=mac-address ]] comment=[/interface wireless registration-table get \$i value-name=radio-name ] }}"