瀏覽代碼

add amd cpu suport

LinkLeong 1 年之前
父節點
當前提交
fa62c65526
共有 2 個文件被更改,包括 6 次插入2 次删除
  1. 1 1
      route/init.go
  2. 5 1
      service/system.go

+ 1 - 1
route/init.go

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

+ 5 - 1
service/system.go

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