Proxy Extension Attribute

kenergy
Contributor

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
0 REPLIES 0