I've stumbled upon this script as I am looking for a way to remove all active users currently on the hotspot, if a certain condition occurs.
What I have setup is a custom login.html for my hotspot login page, inside the html is:
' onerror="this.src='/images/systemdown.jpg'" / align="middle"></center>
What this does, is when a user logs into the hotspot, if the internet is up, it will be able to load a 1x1 pixal gif of nothingness on the login.html hotspot login page. This nothingness gif is located on a reliable webserver and is always available. So the user will see nothing,
However if the internet is down, it will load a systemdown.jpg, that is stored locally on the router. This systemdown.jpg, just states on it that if you see this message the internet is down and we are currently working on the problem to resolve it.
Now this works great except that currently logged in users, or users with cookies that are active will not ever see the login page again when the internet goes down.
What I wanted to do was use the Netwatch feature, to monitor say http://www.google.ca
and ping it, if it fails at pinging google more then 5 times, it will then execute a command to remove all active users and cookies on the router, thus forcing the users back to the main login page, in which they will see the network outtage notice.
I'm not the best at writing scripts, I was wondering if anyone had any ideas how this could be implemented
Basically it would be as such
1.Every 5 seconds ping http://www.google.com
, if it is respond do nothing
2. If ping fails 5 times,
3. remove all active users and their cookies on the router forcing them to have to log in again and thus see the network outage page.
I know with my current knowledge it would take me forever to try and write something like this, but from what I've seem in this thread it seems possible. Any help would be awesome.
EDIT: NVM I've figured it out. http://forum.mikrotik.com/viewtopic.php ... 80#p210880
for anyone else that is interested.