Created
April 10, 2020 03:23
-
-
Save m13253/ad1f20dc9ecb39471902c4213fc7e5fe to your computer and use it in GitHub Desktop.
List proxy server status on macOS
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 | |
networksetup -listallnetworkservices | tail +2 | | |
while read NETWORK_SERVICE | |
do | |
echo 'Network service: '$'\e[34m'"$NETWORK_SERVICE"$'\e[0m' | |
networksetup -getproxyautodiscovery "$NETWORK_SERVICE" | sed 's/^/[WPAD] /' | |
networksetup -getautoproxyurl "$NETWORK_SERVICE" | sed 's/^/[PAC] /' | |
networksetup -getwebproxy "$NETWORK_SERVICE" | sed 's/^/[HTTP] /' | |
networksetup -getsecurewebproxy "$NETWORK_SERVICE" | sed 's/^/[HTTPS] /' | |
networksetup -getftpproxy "$NETWORK_SERVICE" | sed 's/^/[FTP] /' | |
networksetup -getsocksfirewallproxy "$NETWORK_SERVICE" | sed 's/^/[SOCKS] /' | |
networksetup -getstreamingproxy "$NETWORK_SERVICE" | sed 's/^/[RTSP] /' | |
networksetup -getgopherproxy "$NETWORK_SERVICE" | sed 's/^/[Gopher] /' | |
echo | |
done | | |
sed -E 's/(Yes|On)/'$'\e[1;31m''\1'$'\e[0m''/g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment