Skip to content

Instantly share code, notes, and snippets.

@nk23x
Created April 10, 2015 13:39
Show Gist options
  • Save nk23x/a89d92744ce7013da8e2 to your computer and use it in GitHub Desktop.
Save nk23x/a89d92744ce7013da8e2 to your computer and use it in GitHub Desktop.
generate /etc/LOCALSYSID
## /etc/rc.d/rc.local
## generate /etc/LOCALSYSID
## used for creating repos for configs, scripts, etc.
echo "$(dmidecode -t 1 | grep -E '(Manufacturer|Product|Serial)' | cut -d':' -f2 | perl -pe 's/^ ([A-Za-z0-9 ].*)\n/$1--/g;s/\s/-/g;s/^(.*)-/$1/;')UUID-$(dmidecode -t 1 | grep UUID | cut -d':' -f2 | tr -d [:space:])" > /etc/LOCALSYSID
## result is like:
## cat /etc/LOCALSYSID
## FUJITSU-SIEMENS-LIFEBOOK-S6410-YK9S060228-UUID-A36C9E28-7B37-11DD-BEC7-001742C2D0CA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment