Skip to content

Instantly share code, notes, and snippets.

@martinvol
Last active November 15, 2015 05:05
Show Gist options
  • Save martinvol/c9bbdd1933ff8a72eb97 to your computer and use it in GitHub Desktop.
Save martinvol/c9bbdd1933ff8a72eb97 to your computer and use it in GitHub Desktop.
#!/bin/bash
current_network="$(iwgetid -r)"
if [[ -z $current_network ]]; then
echo "Not connected to network :("
exit
fi
echo Your network is $current_network
echo "$(sudo cat /etc/NetworkManager/system-connections/$current_network | grep ^psk= | sed "s/psk=/Password is: /")"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment