MCPcopy
hub / github.com/IceWhaleTech/CasaOS / UpdateSystemVersion

Method UpdateSystemVersion

service/system.go:373–390  ·  view source on GitHub ↗
(version string)

Source from the content-addressed store, hash-verified

371}
372
373func (s *systemService) UpdateSystemVersion(version string) {
374 keyName := "casa_version"
375 Cache.Delete(keyName)
376 if file.Exists(config.AppInfo.LogPath + "/upgrade.log") {
377 os.Remove(config.AppInfo.LogPath + "/upgrade.log")
378 }
379 file.CreateFile(config.AppInfo.LogPath + "/upgrade.log")
380 // go command2.OnlyExec("curl -fsSL https://raw.githubusercontent.com/LinkLeong/casaos-alpha/main/update.sh | bash")
381 if len(config.ServerInfo.UpdateUrl) > 0 {
382 go command.OnlyExec("curl -fsSL " + config.ServerInfo.UpdateUrl + " | bash")
383 } else {
384 osRelease, _ := file.ReadOSRelease()
385 go command.OnlyExec("curl -fsSL https://get.casaos.io/update?t=" + osRelease["MANUFACTURER"] + " | bash")
386 }
387
388 // s.log.Error(config.AppInfo.ProjectPath + "/shell/tool.sh -r " + version)
389 // s.log.Error(command2.ExecResultStr(config.AppInfo.ProjectPath + "/shell/tool.sh -r " + version))
390}
391
392func (s *systemService) UpdateAssist() {
393 command.ExecResultStrArray("source " + config.AppInfo.ShellPath + "/assist.sh")

Callers

nothing calls this directly

Calls 3

DeleteMethod · 0.65
RemoveMethod · 0.65
CreateFileMethod · 0.65

Tested by

no test coverage detected