Page 1 of 1

Script for auto change SSID daily

Posted: Fri Apr 27, 2018 1:32 pm
by Macme
Hi guys

I need to change SSID daily, I was looking for some script for but found some scrip to change SSID when not internet and do not know to adjust .I need daily change SSID no matter internet or not.
I do not know how to do that (make script like that). Is anybody have or can make that script please.

Thank you

Re: Script for auto change SSID daily

Posted: Fri Apr 27, 2018 4:24 pm
by 2frogs
You might provide more detail about what you want the SSID to change to. For example:
/system scheduler
add interval=1d name=schedule on-event=\
    "/interface wireless set wlan1 ssid=(\"MySSID - \".[/system clock get date])" \
    policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-date=apr/27/2018 start-time=00:00:00
For today the SSID would be "MySSID - apr/27/2018" on wlan1. Changing to random SSID or a list of SSID's is more difficult.

Re: Script for auto change SSID daily

Posted: Fri Apr 27, 2018 4:59 pm
by Macme
Thank you

I didn't provide more details sorry. I can explain why i need that.
I know it is not the best solution but workaround for now. I have the issue and as I can see nobody can resolve it.
Hotspot on Rb951 ver ros 6.41, I have redecorated login page.Everything working fine except one thing. When users have on there's mobile devices enabled autojoin and autologin options they automatic get connected to wifi hotspot but without login page and of course they don't have internet connection. I have found some reason for that like because is web pages are most https and not http. I was trying with ssl certificates but it is not the exatly solution for me.
The idea was to change SSID for a few days and again and again with scheduler change the SSID to prevent automatic connections.
Thanks for your script ,, but as you say, changing to random SSID or a list of SSID's will be the good solution but is more difficult and have no idea how to.
Thank you 2frogs

Re: Script for auto change SSID daily

Posted: Mon Apr 30, 2018 8:43 pm
by Macme
2frogs , you help a lot, your script is working like a charm, and it is good solution for now.

Thank you again 2frogs

Re: Script for auto change SSID daily  [SOLVED]

Posted: Tue May 01, 2018 1:35 am
by 2frogs
I had thought of later to just do a simple counter and had meant to post it for you, but I got side tracked and forgot! Here goes:
/ip firewall address-list
add address= comment=1 list=SSIDCounter

/system scheduler
add interval=1d name=schedule on-event=":local SSIDCounter [/ip firewall address\
    -list get [find list=SSIDCounter] comment];\r\
    \n/interface wireless set wlan1 ssid=(\"MySSID-\".\$SSIDCounter);\r\
    \n/ip firewall address-list set [find list=\"SSIDCounter\"] comment=(\$SSIDC\
    \n" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-date=apr/30/2018 start-time=00:00:00
Each day it increase "MySSID-#" by 1 and since it gets stored as a address-list, it will survive a reboot. ;)

Re: Script for auto change SSID daily

Posted: Sun May 06, 2018 12:26 am
by Macme
2frogs thank you for the second script too. Not yet try does but it is a good second decision.
I put your 1st script and it is really good solution, as you say now every day get the same ssid with different date of course and it is good to have a date too :)
I will try your 2nd script too on some other RB to check how it works. I didn't have time for answer you too , sorry about that.
Thanks for your help, you helped me a loot, I appreciate it.