liuxiaolong
2019-12-19 322b01a9580e83983aab0ed71223daba10e2f060
add default upgrade.sh
1个文件已修改
7 ■■■■ 已修改文件
service/SysService.go 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/SysService.go
@@ -216,9 +216,14 @@
        logger.Debug("UnZip err:",err,"zipFile:",zipFilePath)
        return false
    }
    //判断更新包里是否有补丁脚本,如果有则执行,否则执行updatePatch.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)
        logger.Debug("upgrade use ",unZipPath,"upgrade.sh")
    }
    //2.更新系统
    var cmd *exec.Cmd
    updateCmd := fmt.Sprintf("./updatePatch.sh %s %s %s &",unZipPath,zipFilePath,configPatchPath+"/"+identifier)
    cmd = exec.Command("/bin/sh","-c", updateCmd)
    if b, err := cmd.Output(); err != nil {
        logger.Debug("updatePatch err:",err,"result:",string(b))