From 41ab26d4d5974d03d24fa31126dfdaa2638417a6 Mon Sep 17 00:00:00 2001 From: Harry Wixley Date: Fri, 7 Jul 2023 11:12:08 +0100 Subject: [PATCH] GPT-commit: Refactor wix-cli.sh, better Mac support. GPT-commit: Refactor wix-cli.sh for better Mac support, modified functions to improve compatibility and enhance user experience. --- wix-cli.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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..."