zou.yingbin před 4 roky
rodič
revize
27302321ae
1 změnil soubory, kde provedl 1 přidání a 2 odebrání
  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