Community discussions

MikroTik App
just joined
Topic Author
Posts: 2
Joined: Fri May 06, 2016 8:26 am

Cannot run script

Fri May 06, 2016 8:34 am


I've followed the guide here: ... k+RouterOS to setup my Mikrotik wAP series as a hotspot to login using facebook.

Everything works as it should but for some reason the script to change the login screen doesn't seem to work. With the default screen and the appropriate username, I can access internet just fine so I am led to believe that all the rest of the settings are correct and this is the final step.

This is the script in question
:local mac [system routerboard get serial-number];
:if ( [system routerboard get routerboard] = yes ) do {:set mac [system routerboard get serial-number]} else { :set mac [interface ethernet get ether1 mac-address]};

/file set "hotspot/login.html" contents="<html>
<meta http-equiv=\"refresh\" content=\"0; url= ... ogin-only)\" />
<meta http-equiv=\"pragma\" content=\"no-cache\">
<meta http-equiv=\"expires\" content=\"-1\">
I am using the latest RC version of RouterOS but still no dice.

Please help as I have another 2 of these machines to setup and I can't find my way through the scripting.

p.s. The script for the WalledGarden worked without a hitch so I know that scripting works. My assumption is that there is a mistake in the syntax of the above script.
just joined
Posts: 1
Joined: Mon May 23, 2016 7:29 pm

Re: Cannot run script

Mon May 23, 2016 7:42 pm

Did you get any help with this script issue? facing the same problem and I've spent hours on one router. Need some help here.
User avatar
Member Candidate
Member Candidate
Posts: 141
Joined: Thu May 26, 2011 7:08 am

Re: Cannot run script

Tue Nov 08, 2016 7:07 am

Hello, i came across the same issue, and i solved it on a wAP using rOS 6.37.1 and i found that this particular router uses a "flash" prefix before the hotspot directory. so, the script should go like this:
:global mac [/system routerboard get serial-number];
/file set flash/hotspot/login.html contents="
<meta http-equiv=\"refresh\" content=\"0; url=$mac&client_mac=\$(mac)&client_ip=\$(ip)&userurl=\$(link-orig)&login_url=\$(link-login-only)\" />
<meta http-equiv=\"pragma\" content=\"no-cache\">
<meta http-equiv=\"expires\" content=\"-1\">
Hope this helps and if it did, please provide some Reputation ;)
Have a great day!
Certified: MTCNA - MTCWE - MTCRE

Who is online

Users browsing this forum: No registered users and 36 guests