mirror of
https://github.com/netbirdio/netbird.git
synced 2025-02-23 21:51:48 +01:00
Fix linux serial number retrieval (#2206)
* Change source of serial number in sysInfo function The serial number returned by the sysInfo function in info_linux.go has been fixed. Previously, it was incorrectly fetched from the Chassis object. Now it is correctly fetched from the Product object. This aligns better with the expected system info retrieval method. * Fallback to product.Serial in sys info In case of the chassis is "Default String" or empty then try to use product.serial --------- Co-authored-by: Zoltán Papp <zoltan.pmail@gmail.com>
This commit is contained in:
parent
0f63737330
commit
29e5eceb6b
@ -89,5 +89,9 @@ func _getInfo() string {
|
||||
func sysInfo() (serialNumber string, productName string, manufacturer string) {
|
||||
var si sysinfo.SysInfo
|
||||
si.GetSysInfo()
|
||||
return si.Chassis.Serial, si.Product.Name, si.Product.Vendor
|
||||
serial := si.Chassis.Serial
|
||||
if (serial == "Default string" || serial == "") && si.Product.Serial != "" {
|
||||
serial = si.Product.Serial
|
||||
}
|
||||
return serial, si.Product.Name, si.Product.Vendor
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user