From c05d8373500edae0be1ffbbfb70786a0a44ec397 Mon Sep 17 00:00:00 2001 From: LinkLeong Date: Mon, 17 Oct 2022 06:53:23 +0100 Subject: [PATCH] add update url --- model/sys_common.go | 1 + service/system.go | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/model/sys_common.go b/model/sys_common.go index 73316b0..f9476a4 100644 --- a/model/sys_common.go +++ b/model/sys_common.go @@ -26,6 +26,7 @@ type ServerModel struct { Token string USBAutoMount string SocketPort string + UpdateUrl string } // 服务配置 diff --git a/service/system.go b/service/system.go index 8717e4c..845927b 100644 --- a/service/system.go +++ b/service/system.go @@ -221,7 +221,12 @@ func (s *systemService) UpdateSystemVersion(version string) { } file.CreateFile(config.AppInfo.LogPath + "/upgrade.log") //go command2.OnlyExec("curl -fsSL https://raw.githubusercontent.com/LinkLeong/casaos-alpha/main/update.sh | bash") - go command2.OnlyExec("curl -fsSL https://raw.githubusercontent.com/IceWhaleTech/get/main/update.sh | bash") + if len(config.ServerInfo.UpdateUrl) > 0 { + go command2.OnlyExec("curl -fsSL " + config.ServerInfo.UpdateUrl + " | bash") + } else { + go command2.OnlyExec("curl -fsSL https://raw.githubusercontent.com/IceWhaleTech/get/main/update.sh | bash") + } + //s.log.Error(config.AppInfo.ProjectPath + "/shell/tool.sh -r " + version) //s.log.Error(command2.ExecResultStr(config.AppInfo.ProjectPath + "/shell/tool.sh -r " + version)) }