Register
It is currently Sat Apr 19, 2014 2:03 pm

Pre- and post-flight script to configure Local Hostname.


All times are UTC - 6 hours


Post new topic Reply to topic  [ 1 post ] 
Author Message
 PostPosted: Wed Feb 03, 2010 8:10 am   

Joined: Wed Feb 03, 2010 8:02 am
Posts: 1
Hiya! :)

I'll put the question out first and give context after:

How do I point to a string saved in a (separate) text file and perform an action on that? How do I save the string so that it's readable?

Example:

Code:
sudo scutil --set LocalHostName [code that points to directory, text file and variable]
sudo scutil --set ComputerName [code that points to a directory, text file and variable]


-- -- -- -- -- --

What I'm trying to do is create two scripts, one for pre-flight NetInstall imaging and one for post-flight. The pre-flight script is supposed to do these things:

1: Create a Volume from 1% of the disk space with a set name. Accomplished using the "diskutil resizeVolume 99% JHFS Hostname 1%" command.
2: Save the LocalHostName and ComputerName to the new volume.

The post-flight script is supposed to do these things:
1: Read the ComputerName and LocalHostName variables from the text file on the new volume and apply them to the re-installed Mac. Applying the values, once I can find a way to point to them, can be done by the "sudo scutil --set ComputerName/LocalHostName ..." commands. What I need is a way to point.
2: Merge the new volume back into the original volume. This is taken care of by the "diskutil mergePartition" command.
3. Run Permission Repair. Done through the "diskutil repairPermissions" command.

If anyone could help me with this, I'd be incredibly grateful. :D

(If anyone could compile the above into scripts, I'd personally suggest them for Canonization!)

Regards
Pulsifer


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP