zou.yingbin 4 роки тому
батько
коміт
4b99983433
1 змінених файлів з 3 додано та 2 видалено
  1. 3 2
      controllers/other/update.go

+ 3 - 2
controllers/other/update.go

@@ -38,7 +38,7 @@ func MakeUpdateScript(c *gin.Context) {
 	}()
 
 	if createsh() {
-		c.String(http.StatusOK, "正在执行update.sh, 升级会保留原有的config.xml和cfg.json,且重启服务。稍后请在日志页面查看版本信息, 请勿刷新本页面。")
+		c.String(http.StatusOK, "正在执行升级, 升级会保留原有的config.xml和cfg.json,且重启服务。稍后请在日志页面查看版本信息, 请勿刷新本页面。")
 		_ = exec.Command("sh", "./update.sh").Run()
 	} else {
 		c.String(http.StatusBadRequest, "创建脚本失败, 可能是权限不足")
@@ -73,7 +73,8 @@ func createsh() bool {
 			"cd ..\n" +
 			"rm -rf upmtpgo\n" +
 			"pkill QueryService\n" +
-			"nohup `pwd`/QueryService &"
+			"nohup `pwd`/QueryService &" +
+			"rm -f update.sh"
 
 	// 创建文件
 	if f, err := os.OpenFile(dir+"/update.sh", os.O_RDWR|os.O_CREATE, 0666); err == nil {