Community discussions

 
Macme
newbie
Topic Author
Posts: 30
Joined: Fri Apr 22, 2016 3:13 pm

Script for auto change SSID daily

Fri Apr 27, 2018 1:32 pm

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
 
2frogs
Long time Member
Long time Member
Posts: 540
Joined: Fri Dec 03, 2010 1:38 am

Re: Script for auto change SSID daily

Fri Apr 27, 2018 4:24 pm

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.
 
Macme
newbie
Topic Author
Posts: 30
Joined: Fri Apr 22, 2016 3:13 pm

Re: Script for auto change SSID daily

Fri Apr 27, 2018 4:59 pm

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.
Situation:
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
 
Macme
newbie
Topic Author
Posts: 30
Joined: Fri Apr 22, 2016 3:13 pm

Re: Script for auto change SSID daily

Mon Apr 30, 2018 8:43 pm

2frogs , you help a lot, your script is working like a charm, and it is good solution for now.

Thank you again 2frogs
 
2frogs
Long time Member
Long time Member
Posts: 540
Joined: Fri Dec 03, 2010 1:38 am

Re: Script for auto change SSID daily  [SOLVED]

Tue May 01, 2018 1:35 am

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=1.1.1.1 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\
    ounter+1);\r\
    \n\r\
    \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. ;)
 
Macme
newbie
Topic Author
Posts: 30
Joined: Fri Apr 22, 2016 3:13 pm

Re: Script for auto change SSID daily

Sun May 06, 2018 12:26 am

Hello
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.

Who is online

Users browsing this forum: No registered users and 25 guests