/pykawlan

Automatically sign in to KA-WLAN network under Linux

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

pykawlan

Automatically sign in to KA-WLAN network under Linux

This script checks whether a computer is connected to the KA-WLAN network of Karlsruhe, Germany, and - if yes - automatically accepts the terms of use so the internet connection is established without user interaction. The author is not affiliated with KA-WLAN in any way.

Setup

  1. Install dependencies
# on Debian/Ubuntu etc.
sudo apt install python-mechanize git
# if python-mechanize package is not available
sudo pip install mechanize
  1. Download script
cd /tmp
git clone https://github.com/nspo/pykawlan.git
  1. Make script accessible
cd pykawlan
chmod +x pykawlan.py
sudo cp pykawlan.py /usr/local/bin/
  1. If you want it to automatically execute when NetworkManager connects to a network:
cd /etc/NetworkManager/dispatcher.d/
sudo ln -s /usr/local/bin/pykawlan.py 02pykawlan

Notes

  • You can turn off the check whether the computer is connected to KA-WLAN. This might be a problem if nmcli is not available.
  • mechanize is not available for Python 3, so Python 2 was used
  • Q: Why would you use KA-WLAN if you could use KA-sWLAN instead without captive portal? - A: No account needed and sometimes one tends to be more stable than the other.