add amd cpu suport

This commit is contained in:
LinkLeong 2023-09-11 09:39:50 +01:00
parent 3aea945277
commit fa62c65526
2 changed files with 6 additions and 2 deletions

View File

@ -33,7 +33,7 @@ import (
func InitFunction() {
go InitNetworkMount()
go InitInfo()
go InitZerotier()
//go InitZerotier()
}
func InitInfo() {

View File

@ -473,6 +473,7 @@ func GetCPUThermalZone() string {
break
}
}
Cache.SetDefault(keyName, path)
return path
}
@ -483,7 +484,10 @@ func (s *systemService) GetCPUTemperature() int {
if len(path) > 0 {
outPut = string(file.ReadFullFile(path + "/temp"))
} else {
outPut = "0"
outPut = string(file.ReadFullFile("/sys/class/hwmon/hwmon0/temp1_input"))
if len(outPut) == 0 {
outPut = "0"
}
}
celsius, _ := strconv.Atoi(strings.TrimSpace(outPut))