Skip to main content
Question

Proxy Extension Attribute

  • November 16, 2015
  • 0 replies
  • 4 views

Forum|alt.badge.img+11

Not sure if anyone needs an EA for Proxy information:

#!/bin/sh

# Reference: https://macmule.com/2014/12/07/how-to-change-the-automatic-proxy-configuration-url-in-system-preferences-via-a-script/

/usr/sbin/networksetup -detectnewhardware

IFS=$'
'

#Loops through the list of network services
for i in $(networksetup -listallnetworkservices | tail +2 );
do

# Get a list of all Network Devices & Auto Proxy Information
autoProxyURLLocal=`/usr/sbin/networksetup -getautoproxyurl "$i" | head -1 | cut -c 6-`


# Echo's Auto ProxyURL for every Network Services
if [ "$autoProxyURLLocal" != "(null)" ]; then
    echo "<result>$autoProxyURLLocal</result>"
fi

done

unset IFS

exit 0