Skip to main content
Solved

Can you rename the "Automatic" network location with the networksetup command?

  • September 26, 2014
  • 5 replies
  • 36 views

kmitnick
Forum|alt.badge.img+12

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

Best answer by nkalister

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

5 replies

Forum|alt.badge.img+19
  • Contributor
  • Answer
  • September 26, 2014

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

Forum|alt.badge.img+18
  • Valued Contributor
  • September 26, 2014

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 :)


kmitnick
Forum|alt.badge.img+12
  • Author
  • Contributor
  • September 26, 2014

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


Forum|alt.badge.img+19
  • Contributor
  • September 26, 2014

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.


kmitnick
Forum|alt.badge.img+12
  • Author
  • Contributor
  • September 29, 2014

@nkalister,

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

Thanks

Keith