| | |
| | | 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)) |