Here's an example one line command to add a wifi network:
nmcli con add type wifi ifname wlan0 con-name "<con-name>" mode "infrastructure" wifi.ssid "<ssid>" wifi-sec.auth-alg open wifi-sec.key-mgmt wpa-eap 802-1x.domain-suffix-match "<domain>" 802-1x.eap peap 802-1x.identity "<identity>" 802-1x.password "<password>" 802-1x.phase2-auth mschapv2
Or just use the following shell script after you change the credentials:
#!/bin/bash
name="connection_name"
ssid="network"
domain="example.com"
identity="[email protected]"
password="123"
nmcli con add type wifi ifname wlan0 con-name "$name" mode "infrastructure" wifi.ssid "$ssid" wifi-sec.auth-alg open wifi-sec.key-mgmt wpa-eap 802-1x.domain-suffix-match "$domain" 802-1x.eap peap 802-1x.identity "$identity" 802-1x.password "$password" 802-1x.phase2-auth mschapv2