zou.yingbin %!s(int64=4) %!d(string=hai) anos
pai
achega
27302321ae
Modificáronse 1 ficheiros con 1 adicións e 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