Community discussions

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

Cannot run script

Fri May 06, 2016 8:34 am

Hello,

I've followed the guide here: https://socifi-doc.atlassian.net/wiki/d ... 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>
<head>
<meta http-equiv=\"refresh\" content=\"0; url=http://connect.socifi.com/?rad=yes&seri ... ogin-only)\" />
<meta http-equiv=\"pragma\" content=\"no-cache\">
<meta http-equiv=\"expires\" content=\"-1\">
</head>
</html>"
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.
 
PaulMuwanguzi
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
CyB3RMX
Member Candidate
Member Candidate
Posts: 148
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="
<html>
<head>
<meta http-equiv=\"refresh\" content=\"0; url=http://connect.socifi.com/?rad=yes&serial=$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\">
</head>
</html>"
Hope this helps and if it did, please provide some Reputation ;)
JB.

Who is online

Users browsing this forum: No registered users and 56 guests