Last active
May 23, 2020 17:59
-
-
Save zmarffy/dfc3536c809151cfc00d259d9d292e57 to your computer and use it in GitHub Desktop.
Display SSIDs and their entered passwords on Ubuntu
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
#!/usr/bin/env bash | |
shopt -s nullglob | |
ssids=("/etc/NetworkManager/system-connections/*") | |
for ssid in ${ssids[@]}; do | |
ssid_name=${ssid##*/} | |
printf "\e[1m$ssid_name\e[0m : " | |
password=$(cat "$ssid" | grep "psk=" | cut -c 5-) | |
if [ -z "$password" ]; then | |
echo -e "\e[91mNo password\e[39m" | |
else | |
echo $password | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment