Merge pull request #1270 from jeburks2/wwclient_dmidecode
Asset-tag fixes in dhcpd.conf.ww and wwclient
This commit is contained in:
@@ -126,6 +126,15 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
localUUID, _ = sysinfoDump.UUID()
|
||||
x := smbiosDump.SystemEnclosure()
|
||||
tag = strings.ReplaceAll(x.AssetTagNumber(), " ", "_")
|
||||
if tag == "Unknown" {
|
||||
dmiOut, err := exec.Command("dmidecode", "-s", "chassis-asset-tag").Output()
|
||||
if err == nil {
|
||||
chassisAssetTag := strings.TrimSpace(string(dmiOut))
|
||||
if chassisAssetTag != "" {
|
||||
tag = chassisAssetTag
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Raspberry Pi serial and DUID locations
|
||||
// /sys/firmware/devicetree/base/serial-number
|
||||
|
||||
Reference in New Issue
Block a user