Skip to content

Instantly share code, notes, and snippets.

@e-minguez
Created January 27, 2018 14:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save e-minguez/58d5910f0514da98a8188bcd04fd9df2 to your computer and use it in GitHub Desktop.
Save e-minguez/58d5910f0514da98a8188bcd04fd9df2 to your computer and use it in GitHub Desktop.
captive portal login for NetworkManager
# /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