(version string)
| 371 | } |
| 372 | |
| 373 | func (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 | |
| 392 | func (s *systemService) UpdateAssist() { |
| 393 | command.ExecResultStrArray("source " + config.AppInfo.ShellPath + "/assist.sh") |
nothing calls this directly
no test coverage detected