zou.yingbin преди 4 години
родител
ревизия
27302321ae
променени са 1 файла, в които са добавени 1 реда и са изтрити 2 реда
  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