Last active
July 28, 2017 08:20
-
-
Save koivunen/548ccb571b8c1235478b1f3889da560c to your computer and use it in GitHub Desktop.
Eduroam password updater
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 | |
read -p "EDUROAM EMAIL: " EMAIL | |
HASH=$(read -s -p "Password:" | iconv -t utf16le | openssl md4 -hex | awk '{print $2}') | |
cat << EOF | sed "s/EMAIL/$EMAIL/" | sed "s/HASH/$HASH/" | tee /etc/wpa_supplicant/wpa_supplicant.conf | |
ctrl_interface=/var/run/wpa_supplicant | |
network={ | |
scan_ssid=1 | |
ssid="eduroam" | |
key_mgmt=WPA-EAP | |
eap=PEAP | |
identity="EMAIL" | |
password=hash:HASH | |
phase1="peaplabel=0" | |
phase2="auth=MSCHAPV2" | |
} | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment