Skip to content

Instantly share code, notes, and snippets.

@macmule
Created November 21, 2021 20:25
Show Gist options
  • Select an option

  • Save macmule/040f41ca17318ead2f5e669366cf10cf to your computer and use it in GitHub Desktop.

Select an option

Save macmule/040f41ca17318ead2f5e669366cf10cf to your computer and use it in GitHub Desktop.
#!/bin/sh
####################################################################################################
#
# License: https://macmule.com/license/
#
####################################################################################################
# Detects all network hardware & creates services for all installed network hardware
/usr/sbin/networksetup -detectnewhardware
IFS=$'\n'
#Loops through the list of network services
for i in $(/usr/sbin/networksetup -listallnetworkservices | tail +2 );
do
# In absence of being able to unset the auto proxy, set it to " "
/usr/sbin/networksetup -setautoproxyurl "$i" " "
echo "Removed proxy for $i"
# Turn off auto proxy
/usr/sbin/networksetup -setautoproxystate "$i" off
echo "Turned off auto proxy for interface $i"
done
unset IFS
echo "Auto proxy for all interfaces turned off"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment