CasaOS - A simple, easy-to-use, elegant open-source Personal Cloud system.
add update type (#812)
linkbe505795442d
diff --git a/go.mod b/go.modindex caa4be7..556d251 100644--- a/go.mod+++ b/go.mod@@ -4,7 +4,7 @@ go 1.16require (github.com/Curtis-Milo/nat-type-identifier-go v0.0.0-20220215191915-18d42168c63d- github.com/IceWhaleTech/CasaOS-Common v0.4.1-alpha2+ github.com/IceWhaleTech/CasaOS-Common v0.4.1-alpha3github.com/benbjohnson/clock v1.3.0 // indirectgithub.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcfgithub.com/disintegration/imaging v1.6.2diff --git a/go.sum b/go.sumindex ff80f22..f343921 100644--- a/go.sum+++ b/go.sum@@ -3,8 +3,8 @@ github.com/BurntSushi/toml v1.2.0 h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=github.com/Curtis-Milo/nat-type-identifier-go v0.0.0-20220215191915-18d42168c63d h1:62lEBImTxZ83pgzywgDNIrPPuQ+j4ep9QjqrWBn1hrU=github.com/Curtis-Milo/nat-type-identifier-go v0.0.0-20220215191915-18d42168c63d/go.mod h1:lW9x+yEjqKdPbE3+cf2fGPJXCw/hChX3Omi9QHTLFsQ=-github.com/IceWhaleTech/CasaOS-Common v0.4.1-alpha2 h1:O6vDvIy+wFBj6DuUN4ZDLa6M7Cg80SXXpMsM9t2EqpA=-github.com/IceWhaleTech/CasaOS-Common v0.4.1-alpha2/go.mod h1:xcemiRsXcs1zrmQxYMyExDjZ7UHYwkJqYE71IDIV0xA=+github.com/IceWhaleTech/CasaOS-Common v0.4.1-alpha3 h1:jQfIty6u06fPJCutpS+97qr8uho3RpQX+B/CwHPCv/Q=+github.com/IceWhaleTech/CasaOS-Common v0.4.1-alpha3/go.mod h1:xcemiRsXcs1zrmQxYMyExDjZ7UHYwkJqYE71IDIV0xA=github.com/andybalholm/brotli v1.0.1 h1:KqhlKozYbRtJvsPrrEeXcO+N2l6NYT5A2QAFmSULpEc=github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=diff --git a/service/system.go b/service/system.goindex 1986745..f821413 100644--- a/service/system.go+++ b/service/system.go@@ -13,12 +13,13 @@ import ("strings""time"+ "github.com/IceWhaleTech/CasaOS-Common/utils/file""github.com/IceWhaleTech/CasaOS-Common/utils/logger""github.com/IceWhaleTech/CasaOS/model""github.com/IceWhaleTech/CasaOS/pkg/config"command2 "github.com/IceWhaleTech/CasaOS/pkg/utils/command""github.com/IceWhaleTech/CasaOS/pkg/utils/common_err"- "github.com/IceWhaleTech/CasaOS/pkg/utils/file"+"github.com/shirou/gopsutil/v3/cpu""github.com/shirou/gopsutil/v3/disk""github.com/shirou/gopsutil/v3/host"@@ -242,7 +243,8 @@ func (s *systemService) UpdateSystemVersion(version string) {if len(config.ServerInfo.UpdateUrl) > 0 {go command2.OnlyExec("curl -fsSL " + config.ServerInfo.UpdateUrl + " | bash")} else {- go command2.OnlyExec("curl -fsSL https://get.casaos.io/update | bash")+ osRelease, _ := file.ReadOSRelease()+ go command2.OnlyExec("curl -fsSL https://get.casaos.io/update?t=" + osRelease["MANUFACTURER"] + " | bash")}// s.log.Error(config.AppInfo.ProjectPath + "/shell/tool.sh -r " + version)