Skip to main content
Question

Script to Set proxy failing


Forum|alt.badge.img+10

I'm using a script to set the proxy for the Ethernet and Wi-Fi interfaces run at reboot. If I run the script manually it works great. Everything comes out set as it should. If I run it as part of the imaging workflow it will set the proxy for ethernet but fail to set it for the Wi-Fi interface. It's a pretty simple script. I can run it via policy, type it in, really any way other than as part of imaging, which is the one I want.

Anyone have any experience that would tell me what I can do to get a working networksetup script to work correctly as part of imaging for Wi-Fi?

6 replies

Forum|alt.badge.img+10
  • New Contributor
  • 596 replies
  • August 11, 2014

can you post the script?
how are you running the script in your imaging workflow? are you using casper imaging? firstboot packages? deploy studio?


bentoms
Forum|alt.badge.img+35
  • Legendary Contributor
  • 4331 replies
  • August 11, 2014

We use the following to set proxies for all Ethernet interfaces (incl. USB or Thunderbolt), Wireless & VPN.

Should be simple enough to adapt as needed: http://macmule.com/2011/09/09/how-to-change-the-automatic-proxy-configuration-url-in-system-preferences-via-a-script/


Forum|alt.badge.img+10
  • Author
  • Contributor
  • 53 replies
  • August 12, 2014

We're using Casper Imaging, the script is part of the imaging workflow. The script is really just the networksetup command a few times over.

/usr/sbin/networksetup -setwebproxy "Wi-Fi" "our.proxy.com" "port#"
/usr/sbin/networksetup -setsecurewebproxy "Wi-Fi" "our.proxy.com" "port#"

/usr/sbin/networksetup -setwebproxy "Ethernet" "our.proxy.com" "port#"
/usr/sbin/networksetup -setsecurewebproxy "Ethernet" "our.proxy.com" "port#"

I like @bentoms script though, and may borrow some portions of it. However, I'm not sure it will actually change it's functionality. Ultimately it comes down to the same command. Maybe I'm wasting my time trying to get it to run during imaging and should just schedule it as policy.

"Wi-Fi" is the correct way to specify the particular network service right? I got it from running networksetup -listallnetworkservices, but it feels like such a sloppy way to reference an interface.


Forum|alt.badge.img+12
  • Contributor
  • 64 replies
  • May 28, 2015

Have you figured out how to accomplish this? I'm trying to do the same thing and using a similar script.


Forum|alt.badge.img+10
  • Author
  • Contributor
  • 53 replies
  • May 28, 2015

@jleomcdo I never got it to work correctly as part of my imaging workflow. I ended up running it as a reoccuring check-in item daily.


bentoms
Forum|alt.badge.img+35
  • Legendary Contributor
  • 4331 replies
  • May 30, 2015

@jleomcdo & @jhuhmann When I used the above linked script, I use to run it at imaging as part of my postflight policy with no issues.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings