aurora.localbincampus-login
| 1 | #!/bin/bash |
| 2 | |
| 3 | URL=$(curl -s -D - -o /dev/null http://neverssl.com 2>/dev/null \ |
| 4 | | grep -i '^location:' \ |
| 5 | | head -n1 \ |
| 6 | | sed 's/^[Ll]ocation:[[:space:]]*//' \ |
| 7 | | tr -d '\r') |
| 8 | |
| 9 | if [[ -z "$URL" ]]; then |
| 10 | echo "Already authenticated or no captive portal detected." |
| 11 | exit 0 |
| 12 | fi |
| 13 | |
| 14 | echo "Opening captive portal: $URL" |
| 15 | "$BROWSER" "$URL" |