Having problem with script to setwebproxy

RicevilleIT
New Contributor II

I am look for some help with a script I am trying to run that will turn on Airports web proxy, add the domain and port and turn on authentication and the corresponding username/password. I want to have the proxy authentication to happen blind to users

I am able to execute the script without any errors, the web proxy turns on and the fields for my domain and port all populate. However turning on authentication and the username/password blanks do not populate

#!/bin/bash 

/usr/sbin/networksetup -setwebproxy "Airport" "proxy.server.com" "123" "On" "proxyuser" "proxypass"

exit 0

Thanks in advance!
Cory

5 REPLIES 5

Hobbs155
Contributor

I'm having the exact same issue. If i find anything i will let you know

JRM
Contributor

When you run:

/usr/sbin/networksetup -listallnetworkservices

Is the network service listed as "Airport" or as something else?

bbass
Contributor

You might have a look at this thread, too.

https://jamfnation.jamfsoftware.com/discussion.html?id=6562

Should give some helpful hints.

RicevilleIT
New Contributor II

using

/usr/sbin/networksetup -setwebproxy "Airport" "proxy.server.com" "123" "On" "proxyuser" "proxypass"

I could get get the proxy and port to populate, but the user/pass was hit or miss, which was what I was aiming for.

I ended up using the SetWebProxy.sh from the Resource Kit, which accomplished setting the proxy and port, but not the user/pass

but what I was really shooting for was to make it transparent for the end user that they did not need to manually authenticate and clicking Always Allow when prompted for keychain access to the proxy. We ended up rolling with it and it all worked out, just was going for convenience for users.

mscottblake
Valued Contributor

This is only a thought as I've never played with that flag in networksetup, but what if you set it to "on" instead of "On"? Does that make any difference?

I've seen flags that are case sensitive and others that are not within the same binary before. I know it's a stretch, but worth a try.