I am trying to create a bash script that will update the mac's proxy settings and a few other places when a user changes their password every 60 days. So far I am trying to use this command for the proxy
networksetup -setwebproxy wi-fi proxy.example.com 8080 on "$USER" "$NewPassword"
but when I run the command after the proxy has been set up, it gives an error.
networksetup[32852:1867937] error -25299 attempting to create account and password for proxy: proxy.example.com:8080
The error will only shows up when the username and password have been previously set up, but if I delete the username and password from the GUI, then run the command it will setup the authentication.
Anyone have any ideas?