Skip to content

Commit

Permalink
feat : fall back to hostname on linux (#28)
Browse files Browse the repository at this point in the history
- useful for Docker "from scratch" images
- any other linux distro that doesn't have these files - while common, they aren't compulsory
  • Loading branch information
bguiz authored and automation-stack committed Jan 16, 2018
1 parent 38af074 commit 65a3bf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let {platform}: Object = process,
win32: `${win32RegBinPath[isWindowsProcessMixedOrNativeArchitecture()]}\\REG ` +
'QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography ' +
'/v MachineGuid',
linux: 'cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null | head -n 1 || :',
linux: '( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :',
freebsd: 'kenv -q smbios.system.uuid'
};

Expand Down

0 comments on commit 65a3bf4

Please sign in to comment.