Skip to content

Instantly share code, notes, and snippets.

@diemol
Last active November 21, 2025 11:57
Show Gist options
  • Select an option

  • Save diemol/65eae1192e8b70233069e11cf5debdf6 to your computer and use it in GitHub Desktop.

Select an option

Save diemol/65eae1192e8b70233069e11cf5debdf6 to your computer and use it in GitHub Desktop.
#!/bin/bash
# -------------------------------------
# Demo: Set PAC Proxy on macOS
# Network service: Ethernet
# Public PAC URL: http://wpad.example.net/wpad.dat
# -------------------------------------
NETWORK_SERVICE="Ethernet"
PAC_URL="https://gist.github.com/diemol/9ef7fed6e0650953d9100122ed8accc4/raw/22ca0ae270d786dcc57f9ed0c6845015abdd445f/proxy.pac"
echo "🔧 Setting PAC proxy for $NETWORK_SERVICE..."
networksetup -setautoproxyurl "$NETWORK_SERVICE" "$PAC_URL"
networksetup -setautoproxystate "$NETWORK_SERVICE" on
echo "✅ PAC file applied:"
echo " $PAC_URL"
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment