Auto login to open Wifi

If you go to many places with open wireless access you might find it annoying that every time you have to open the browser to accept the same rules and conditions from that provider before you can have real internet access. It is even worse if you have tabs left open from your last session and they all now point to the same wifi login page!

However, if you are using Linux and you have NetworkManager set as the default network management tool then I have a solution for you, NetworkManager will run the scripts inside the folder “dispatcher.d” whenever the connection status changed for any of the network cards on the machine. Under Fedora the folder is located in “/etc/NetworkManager/dispatcher.d/” and I will assume other Linux distributions will be similar if not the same.

So all you have to do is create a script in that folder that will run whenever the wireless connection is up and the network name (SSID) matches the location that have the open wifi, then the script should automate the process of clicking on the accept button or whatever it takes to get internet access.

I have already made such a script that will allow me to login to Panera Bread and Baltimore County Public Library, but it can be expanded easily to include other locations. The first part of the script should be placed under the “dispatcher.d” folder and should be accessible by “root” only (This is a security feature, since NetworkManager will execute all scripts in that folder as root and anyone with access to these files can change their content to do other stuff that might harm your system, so make sure to set the permission to root only). That script will parse the iwconfig output to find the name of the wifi and call the script that matches the name if any.

Continue reading “Auto login to open Wifi”