Krolyxon
Commit 1d0e403

Branches

Refs →

aurora.localbincampus-login

15 lines · 346 B · Bourne Again Shell (bash)

1#!/bin/bash
2
3URL=$(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
9if [[ -z "$URL" ]]; then
10 echo "Already authenticated or no captive portal detected."
11 exit 0
12fi
13
14echo "Opening captive portal: $URL"
15"$BROWSER" "$URL"