Last active
August 4, 2022 09:30
-
-
Save Ara4Sh/6e4b40bbb2311e608ba91774e9ee9366 to your computer and use it in GitHub Desktop.
Reload PAC on macos thanks to: https://q1f4mmprz7gko.wordpress.com/2015/07/10/forcing-mac-os-x-and-safari-to-reload-a-pac-file/
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
#! /bin/sh -u | |
networksetup -listallnetworkservices | awk 'NR>1' | while read SERVICE ; do | |
if networksetup -getautoproxyurl "$SERVICE" | grep '^Enabled: Yes' >/dev/null; then | |
networksetup -setautoproxystate "$SERVICE" off | |
sleep 2 | |
networksetup -setautoproxystate "$SERVICE" on | |
echo "$SERVICE" bounced. | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@animatedcreativity thanks, I updated the snippet.