Created
January 27, 2018 14:09
-
-
Save e-minguez/58d5910f0514da98a8188bcd04fd9df2 to your computer and use it in GitHub Desktop.
captive portal login for NetworkManager
This file contains 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
# /etc/NetworkManager/dispatcher.d/41-captiveportal | |
#!/bin/bash | |
SSID='MYSSID' | |
USER='user' | |
PASSWORD='password' | |
HOST="mycaptiveportal.example.com" | |
URL="https://${HOST}/login.php" | |
if [ "${CONNECTION_ID}" == "${SSID}" ]; then | |
curl -s ${URL} -H "Host: ${HOST}" -H "Referer: ${URL}" --data "user=${USER}&auth=any&password=${PASSWORD}" &> /dev/null | |
fi; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment