zou.yingbin hace 4 años
padre
commit
27302321ae
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      controllers/other/update.go

+ 1 - 2
controllers/other/update.go

@@ -73,9 +73,8 @@ func createsh() bool {
 			"nohup `pwd`/QueryService &"
 
 	// 创建文件
-	if f, err := os.Create(dir + "/update.sh"); err == nil {
+	if f, err := os.OpenFile(dir+"/update.sh", os.O_RDWR|os.O_CREATE, 0777); err == nil {
 		_, err = f.Write([]byte(sh))
-		f.Chmod(777)
 		f.Close()
 	} else {
 		return false