Skip to content

Instantly share code, notes, and snippets.

@rubenhorn
Created October 6, 2022 11:16
Show Gist options
  • Save rubenhorn/c6862b21f9313c8bc7dcee30a3717c74 to your computer and use it in GitHub Desktop.
Save rubenhorn/c6862b21f9313c8bc7dcee30a3717c74 to your computer and use it in GitHub Desktop.
nmcli eduroam script
#! /bin/bash
if [ "$1" == "rm" ]
then
nmcli connection delete eduroam 2>/dev/null
exit
fi
if [ -z "$(nmcli con show | grep eduroam)" ]
then
device=$(nmcli device | grep "\swifi\s" | awk '{print $1}')
echo -n "Identity:"
read identity
echo -n "Password:"
read -s password
echo ""
nmcli con add \
type wifi \
con-name "eduroam" \
wifi-sec.key-mgmt "wpa-eap" \
ssid "eduroam" \
ifname $device \
802-1x.identity $identity \
802-1x.password $password \
802-1x.eap "peap" \
802-1x.phase2-auth "mschapv2"
fi
nmcli connection up eduroam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment