rtrouton / rtrouton_scripts

Scripts to share
MIT License
1.3k stars 491 forks source link

Update initialsetup.sh #12

Closed thealanberman closed 10 years ago

thealanberman commented 10 years ago

Simpler way to get Hardware UUID using system_profiler and awk.

rtrouton commented 10 years ago

This code is there to fix an issue seen on older Macs and also in VMware's OS X virtual machines, where the UUID gets reported as something like "00000000-0000-1000-8000-000C29A0FD07". The ByHosts prefs naming generally don't work with a UUID that begins with "00000000-0000-1000-8000-", so the OS will then ignore ByHosts prefs files named like that and will instead generate a new ByHosts prefs file from its own defaults.

To address this, the code will lop off the "00000000-0000-1000-8000-" part if it's detected as part of the reported UUID and feed the remainder to the ByHosts prefs file. That results in a much shorter result like "000c29a0fd07", which the ByHosts prefs naming can work with.