Skip to content

Instantly share code, notes, and snippets.

@badstreff
Created December 2, 2016 18:21
Show Gist options
  • Save badstreff/5a5512382d8573af37a206a166d96287 to your computer and use it in GitHub Desktop.
Save badstreff/5a5512382d8573af37a206a166d96287 to your computer and use it in GitHub Desktop.
#!/bin/bash
serial=$(system_profiler SPHardwareDataType | awk '/Serial/ {print $4}')
scutil --set HostName $serial
scutil --set LocalHostName $serial
scutil --set ComputerName $serial
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment