Commit 0e2d495f authored by szh's avatar szh

pai升级替换配置文件,用户不需要改配置文件

parent a7808a46
...@@ -166,8 +166,22 @@ func UpdatePai(c *gin.Context) { ...@@ -166,8 +166,22 @@ func UpdatePai(c *gin.Context) {
app.DPercent.Flag = false app.DPercent.Flag = false
return return
} }
//对比配置文件 比较麻烦 //替换配置文件
mvconf := exec.Command("mv",setting.Chain33Pai.Name+"_"+req.Version+"/conf/app.ini",".")
err = mvconf.Start()
if err != nil {
tlog.Error("mvconf","err",err)
appG.Response(http.StatusOK, e.MV_ERROR, err)
app.DPercent.Flag = false
return
}
err = mvconf.Wait()
if err != nil {
tlog.Error("mvconf","err",err)
appG.Response(http.StatusOK, e.MV_ERROR, err)
app.DPercent.Flag = false
return
}
//删除temp文件夹 //删除temp文件夹
//替换原执行文件 //替换原执行文件
remove := exec.Command("rm","-rf",setting.Chain33Pai.Name+"_"+req.Version,name) remove := exec.Command("rm","-rf",setting.Chain33Pai.Name+"_"+req.Version,name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment