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?
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.
(If anyone could compile the above into scripts, I'd personally suggest them for Canonization!)