You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

21 rivejä
386 B

  1. package platform_device_id
  2. import (
  3. // "fmt"
  4. "os/exec"
  5. "github.com/pkg/errors"
  6. )
  7. func getPlatformDeviceId() (deviceId string, err error) {
  8. //dmidecode -s system-uuid
  9. arg := []string{"-s","system-uuid"}
  10. cmd := exec.Command("dmidecode", arg...)
  11. d, err := cmd.CombinedOutput()
  12. if err != nil {
  13. return "", errors.Wrap(err, "failed to get deviceId")
  14. }
  15. return string(d), nil
  16. }