Skip to content

Instantly share code, notes, and snippets.

@koivunen
Last active July 28, 2017 08:20
Show Gist options
  • Save koivunen/548ccb571b8c1235478b1f3889da560c to your computer and use it in GitHub Desktop.
Save koivunen/548ccb571b8c1235478b1f3889da560c to your computer and use it in GitHub Desktop.
Eduroam password updater
#!/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