Posted on 09-26-2014 01:00 PM
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
Solved! Go to Solution.
Posted on 09-26-2014 01:04 PM
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
Posted on 09-26-2014 01:04 PM
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
Posted on 09-26-2014 01:11 PM
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 :)
Posted on 09-26-2014 01:11 PM
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
Posted on 09-26-2014 01:26 PM
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.
Posted on 09-29-2014 08:06 AM