Set Proxy on all available network services

When you want to set the proxy on all available network services (say with JAMF’s Casper Suite at imaging time?)


## A few variables we'll need for later

declare -a NetServs

# Dealing with IFS as we need to alter it to avoid space issues.

#Define what Network Services are available.
NetServs=( `networksetup -listallnetworkservices | cut -d "." -f 2-` )

# Go through each network service and set the autoproxy.

for NetServ in ${NetServs[*]}; do
networksetup -setautoproxyurl "$NetServ" $ProxyURL
echo "$NetServ" is now set to use the proxy at $ProxyURL

exit 0


till next time

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s