- This topic has 6 replies, 5 voices, and was last updated 16 years ago by
AllanMarcus.
-
AuthorPosts
-
October 21, 2008 at 11:42 pm #374519
robmorton
ParticipantDoes anyone know a means to create a new location via the command line? We do not use DHCP, but I want to leave the Automatic location in tact and just configure the DNS information and search domain. Any thoughts?
October 22, 2008 at 5:30 pm #374526Greg Neagle
ParticipantChris Adams wrote a nice little Python tool (using PyObjC binding):
http://code.google.com/p/pymacadmin/source/browse/trunk/bin/create-location.py
-Greg
March 21, 2009 at 3:48 pm #375773mleacy
ParticipantThis looks interesting, but not being well versed in python, I don’t know where to put the new location’s name in this script.
Anybody able to give a little direction?
Thanks!
March 23, 2009 at 1:25 pm #375780paulaust
ParticipantI have been searching for this very thing for the last several months and found a tool just this week that has promise. Check out ncutil. http://turin.nss.udel.edu/ncutil/ It was created by Dr Jeffrey Frey of the University of Delaware. I was able to use this in a script along with scselect and network setup to create two new network locations, configure the proxy settings for one, switch to the preferred location and destroy the Automatic location. I haven’t yet included the script in a package to add to my image, but should have that knocked out shortly.
hope this helps.
March 23, 2009 at 11:29 pm #375787AllanMarcus
Participant[QUOTE][u]Quote by: paulaust[/u][p]I have been searching for this very thing for the last several months and found a tool just this week that has promise. Check out ncutil. http://turin.nss.udel.edu/ncutil/ It was created by Dr Jeffrey Frey of the University of Delaware. I was able to use this in a script along with scselect and network setup to create two new network locations, configure the proxy settings for one, switch to the preferred location and destroy the Automatic location. I haven’t yet included the script in a package to add to my image, but should have that knocked out shortly.
[/p][/QUOTE]ncutil has been around for a while. What worries me about it is that it has not been updated in over a year. I don’t know what will happen to it when Snow Leopard comes out.
I looked at the python script and it basically just copies the automatic location and names the copy what you would like. You then can use existing tools to make this new location the active location and modify it. The downside is that you will interrupt existing network which you make the changes. I don’t know if that can be done in a payloadless post action script.
Apple really needs to have an API to create a location and configure it.
-Allan
March 24, 2009 at 8:10 pm #375798mleacy
ParticipantOne of the folks on the Apple boards mentioned that scutil is capable of doing this. Does that make sense to anyone here?
March 25, 2009 at 10:22 pm #375816AllanMarcus
Participantopen terminal
type: man scutilscutil cannot create a location.
-
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed