2018-05-27 19:48:57 +00:00
|
|
|
// +build linux
|
|
|
|
|
|
|
|
package xid
|
|
|
|
|
|
|
|
import "io/ioutil"
|
|
|
|
|
|
|
|
func readPlatformMachineID() (string, error) {
|
2021-04-03 17:16:46 +00:00
|
|
|
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
|
|
|
|
}
|