Created
October 6, 2022 11:16
-
-
Save rubenhorn/c6862b21f9313c8bc7dcee30a3717c74 to your computer and use it in GitHub Desktop.
nmcli eduroam script
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
#! /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