Commit 92a092da authored by ligaishun's avatar ligaishun

增添脚本文件拷贝及权限修改

parent 77566e3d
package v1
import (
"os"
"net/http"
"chain33-pai/pkg/e"
"chain33-pai/pkg/app"
......@@ -182,8 +183,12 @@ func UpdatePai(c *gin.Context) {
app.DPercent.Flag = false
return
}
os.RemoveAll("scripts")
os.Mkdir("scripts",0600)
//删除temp文件夹
//替换原执行文件
app.MVScripts(setting.Chain33Pai.Name+"_"+req.Version,".")
remove := exec.Command("rm","-rf",setting.Chain33Pai.Name+"_"+req.Version,name)
err = remove.Start()
if err != nil {
......
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