Skip to content

Commit be50579

Browse files
authored
add update type (#812)
1 parent 91bb0cb commit be50579

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.16
44

55
require (
66
github.com/Curtis-Milo/nat-type-identifier-go v0.0.0-20220215191915-18d42168c63d
7-
github.com/IceWhaleTech/CasaOS-Common v0.4.1-alpha2
7+
github.com/IceWhaleTech/CasaOS-Common v0.4.1-alpha3
88
github.com/benbjohnson/clock v1.3.0 // indirect
99
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
1010
github.com/disintegration/imaging v1.6.2

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ github.com/BurntSushi/toml v1.2.0 h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0
33
github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
44
github.com/Curtis-Milo/nat-type-identifier-go v0.0.0-20220215191915-18d42168c63d h1:62lEBImTxZ83pgzywgDNIrPPuQ+j4ep9QjqrWBn1hrU=
55
github.com/Curtis-Milo/nat-type-identifier-go v0.0.0-20220215191915-18d42168c63d/go.mod h1:lW9x+yEjqKdPbE3+cf2fGPJXCw/hChX3Omi9QHTLFsQ=
6-
github.com/IceWhaleTech/CasaOS-Common v0.4.1-alpha2 h1:O6vDvIy+wFBj6DuUN4ZDLa6M7Cg80SXXpMsM9t2EqpA=
7-
github.com/IceWhaleTech/CasaOS-Common v0.4.1-alpha2/go.mod h1:xcemiRsXcs1zrmQxYMyExDjZ7UHYwkJqYE71IDIV0xA=
6+
github.com/IceWhaleTech/CasaOS-Common v0.4.1-alpha3 h1:jQfIty6u06fPJCutpS+97qr8uho3RpQX+B/CwHPCv/Q=
7+
github.com/IceWhaleTech/CasaOS-Common v0.4.1-alpha3/go.mod h1:xcemiRsXcs1zrmQxYMyExDjZ7UHYwkJqYE71IDIV0xA=
88
github.com/andybalholm/brotli v1.0.1 h1:KqhlKozYbRtJvsPrrEeXcO+N2l6NYT5A2QAFmSULpEc=
99
github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=
1010
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=

service/system.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ import (
1313
"strings"
1414
"time"
1515

16+
"github.com/IceWhaleTech/CasaOS-Common/utils/file"
1617
"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
1718
"github.com/IceWhaleTech/CasaOS/model"
1819
"github.com/IceWhaleTech/CasaOS/pkg/config"
1920
command2 "github.com/IceWhaleTech/CasaOS/pkg/utils/command"
2021
"github.com/IceWhaleTech/CasaOS/pkg/utils/common_err"
21-
"github.com/IceWhaleTech/CasaOS/pkg/utils/file"
22+
2223
"github.com/shirou/gopsutil/v3/cpu"
2324
"github.com/shirou/gopsutil/v3/disk"
2425
"github.com/shirou/gopsutil/v3/host"
@@ -242,7 +243,8 @@ func (s *systemService) UpdateSystemVersion(version string) {
242243
if len(config.ServerInfo.UpdateUrl) > 0 {
243244
go command2.OnlyExec("curl -fsSL " + config.ServerInfo.UpdateUrl + " | bash")
244245
} else {
245-
go command2.OnlyExec("curl -fsSL https://get.casaos.io/update | bash")
246+
osRelease, _ := file.ReadOSRelease()
247+
go command2.OnlyExec("curl -fsSL https://get.casaos.io/update?t=" + osRelease["MANUFACTURER"] + " | bash")
246248
}
247249

248250
// s.log.Error(config.AppInfo.ProjectPath + "/shell/tool.sh -r " + version)

0 commit comments

Comments
 (0)