5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-09-19 21:32:31 +00:00
matterbridge/vendor/github.com/rs/xid/hostid_linux.go

14 lines
264 B
Go
Raw Permalink Normal View History

2018-05-27 19:48:57 +00:00
// +build linux
package xid
import "io/ioutil"
func readPlatformMachineID() (string, error) {
b, err := ioutil.ReadFile("/etc/machine-id")
if err != nil || len(b) == 0 {
b, err = ioutil.ReadFile("/sys/class/dmi/id/product_uuid")
}
2018-05-27 19:48:57 +00:00
return string(b), err
}