Skip to main content

I need a way to rename the "Automatic" network location to "Work" via the command line.



I had a look at the man page for networksetup but don't see anything that would help.



Has anyone found a way to accomplish this?



Any advice is greatly appreciated.



Thanks



Keith

unless you've customized automatic, that location is just the bare defaults that would be applied to any new location.
so, don't rename it- make a new location named whatever you want, then delete the automatic location.



networksetup -createlocation Work populate
networksetup -switchtolocation Work
networksetup -deletelocation Automatic

nice and concise @nkalister
after that you might want to loop on each service and set proxies, turn off IPv6 etc, since you're there and messing with stuff anyway :)


nkalister,



I appreciate your prompt response. I was able to get it working in the past with what you recommended, but was curious to know if there was a way to rename the Automatic location without deleting it. If not, your way does indeed work.



Thanks



Keith


Keith, AFAIK there is no way to rename it. there are no documented switches for networksetup that'll do it.



and good point, nessts . . .best way to handle this in a workflow is to configure your locations first, then set your settings within the locations. Scripts like that are where I learned do loops and iterating though the contents of arrays! good times.


@nkalister,



I'm marking your post as the answer. I appreciate everyones input.



Thanks



Keith