diff --git a/wix-cli.sh b/wix-cli.sh index 0ea8b8d..954d0db 100755 --- a/wix-cli.sh +++ b/wix-cli.sh @@ -832,8 +832,16 @@ elif [ "$1" = "hardware-ports" ]; then fi elif [ "$1" = "wpass" ]; then - info_text "Listing saved Wifi passwords:" - sudo grep -r '^psk=' /etc/NetworkManager/system-connections/ + if mac; then + info_text "Enter the SSID of the network you would like to get the password for:" + read -r ssid + info_text "Getting password for $ssid..." + security find-generic-password -ga "$ssid" | grep "password:" + echo "" + else + info_text "Listing saved Wifi passwords:" + sudo grep -r '^psk=' /etc/NetworkManager/system-connections/ + fi elif [ "$1" = "speedtest" ]; then info_text "Running speedtest..."