From eda082b08262171fe406d95ad4db8784fa7e5451 Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期五, 20 十二月 2019 16:48:36 +0800 Subject: [PATCH] test --- service/SysService.go | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/service/SysService.go b/service/SysService.go index 4e57f6b..ab26ee4 100644 --- a/service/SysService.go +++ b/service/SysService.go @@ -135,6 +135,9 @@ logger.Debug("write chunkData err:",err2,"nn:",nn) return false } + if err = writer.Flush(); err != nil { + logger.Debug("write flush err:",err) + } isComplete := false dirFiles, _ := ioutil.ReadDir(fileTmpPath) if dirFiles != nil && len(dirFiles) == arg.TotalChunks { @@ -243,10 +246,21 @@ logger.Debug("UnZip err:",err,"zipFile:",zipFilePath) return false } + + //濡傛灉閫氱敤鑴氭湰鏈夋洿鏂帮紝鍒欐洿鏂伴�氱敤鑴氭湰 + if util.Exists(unZipPath+"updatePatch.sh") { + cpStr := fmt.Sprintf("cp %s /opt/vasystem/bin",unZipPath+"updatePatch.sh") + b, err := ExecCmd(cpStr) + if err != nil { + logger.Debug("cp updatePatch.sh to bin err:",err,"result:",string(b)) + return false + } + } + //鍒ゆ柇鏇存柊鍖呴噷鏄惁鏈夎ˉ涓佽剼鏈紝濡傛灉鏈夊垯鎵ц锛屽惁鍒欐墽琛寀pdatePatch.sh updateCmd := fmt.Sprintf("./updatePatch.sh %s %s %s &",unZipPath,zipFilePath,configPatchPath+"/"+identifier) if util.Exists(unZipPath+"upgrade.sh") { - updateCmd = fmt.Sprintf("%supgrade.sh %s %s %s &",unZipPath,unZipPath,zipFilePath,configPatchPath+"/"+identifier) + updateCmd = fmt.Sprintf("%supgrade.sh %s %s %s",unZipPath,unZipPath,zipFilePath,configPatchPath+"/"+identifier) } //2.鏇存柊绯荤粺 b,err := ExecCmd(updateCmd) -- Gitblit v1.8.0