-
-
Save m-rey/704810d16bf020ca86500537f76e9366 to your computer and use it in GitHub Desktop.
Small bash script for automatic captive portal log in to the “@BayernWLAN” using curl.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env -S bash -e | |
| # Only works with DNS name if using provider DNS | |
| # ADDRESS="hotspot.vodafone.de/bayern" | |
| # IP-Address might be different depending on location | |
| ADDRESS="10.175.177.131" | |
| LOGIN_PROFILE="6" | |
| SESSION_KEY=$(curl -ks 'https://'${ADDRESS}'/api/v4/session' | jq '.session') | |
| CURRENT_PROFILE=$(curl -ks 'https://'${ADDRESS}'/api/v4/session' | jq '.currentLoginProfile') | |
| if [ ${CURRENT_PROFILE} != ${LOGIN_PROFILE} ]; then | |
| echo "Not logged in! Logging in..." | |
| curl -k 'https://'${ADDRESS}'/api/v4/login?loginProfile='${LOGIN_PROFILE}'&accessType=termsOnly&sessionID='${SESSION_KEY} | |
| else | |
| echo "Already logged in, nothing to do..." | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment