Last active
November 11, 2015 22:57
-
-
Save wmonk/4784c626bbd331f0877d to your computer and use it in GitHub Desktop.
Get wifi password
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
# ssid will give the SSID of the current network you are connected to | |
alias ssid='/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk '\''/ SSID/ {print substr($0, index($0, $2))}'\''' | |
# wifi will return 'password: "your-password"' | |
alias wifi='security find-generic-password -D "AirPort network password" -a $(ssid) -g | awk '\''/ password: "/ {print substr($0, index($0, $2))}'\''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment