Auto-login to Starbucks Wifi

At Starbucks I, for one, find it pretty annoying to go to this BT Wifi login page and click the stupid button to get internet access – especially since my Delicious plugin always tries to connect to delicious.com before I can click the button, resulting in tons of error messages about bad SSL certs and stuff like that. Then I remembered I can program and wrote a short script for the NetworkManager in Ubuntu and probably for other Linux distros.

Take the following code and put it into an executable file named /etc/NetworkManager/dispatcher.d/openbt or similar.

 #!/bin/bash
 DOMAIN_NAME="$DHCP4_DOMAIN_NAME"
 if [[ $DOMAIN_NAME =~ .btopenzone.com ]]; then
    wget -O /dev/null https://www.btopenzone.com:8443/freeToEndUserLogon
 fi

This will be run every time you log into a network. The code first checks if it looks like you are now in the BT Wifi network deployed in German Starbucks caf├ęs. If this is the case, it „clicks the button“ by requesting the URL of the button and writing the output to where the sun never shines.

If everything works, you’ll switch on Wifi and can use the internet without clicking the button. Have fun.

Comments are closed.