From 1e3df3f3cf88e9274f4347daa8e66dce57be6b89 Mon Sep 17 00:00:00 2001 From: sunty <1172534965@qq.com> Date: 星期三, 15 四月 2020 12:01:39 +0800 Subject: [PATCH] test get line --- controllers/swfsControllers.go | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/controllers/swfsControllers.go b/controllers/swfsControllers.go index b87376d..d1159c9 100644 --- a/controllers/swfsControllers.go +++ b/controllers/swfsControllers.go @@ -92,8 +92,9 @@ StopServer(config.Server.ScriptPath) time.Sleep(time.Second * 1) StartServer(config.Server.ScriptPath) - result := strings.Split("=", GetLocalStartupItem(config.Server.ScriptPath, StartServerScript))[1] - util.ResponseFormat(c, code.Success, result) + fmt.Println("GetLocalStartupItem: ", GetLocalStartupItem(config.Server.ScriptPath, StartServerScript)) + //result := strings.Split("=", GetLocalStartupItem(config.Server.ScriptPath, StartServerScript))[1] + //util.ResponseFormat(c, code.Success, result) } //鍚姩鏈嶅姟 @@ -174,6 +175,7 @@ //鑾峰彇鏈湴鍚姩椤� func GetLocalStartupItem(scriptPath string, scriptFile string) string { startupItem := GetNowLineContent(scriptPath+"/"+scriptFile, Option) + fmt.Println("startupItem: ", startupItem) return startupItem } @@ -212,7 +214,8 @@ //鑾峰彇鏌ユ壘鍐呭褰撳墠琛屽唴瀹� func GetNowLineContent(filePath string, searchContent string) string { - scriptStr := "cat" + filePath + "| grep " + searchContent + scriptStr := "cat " + filePath + "| grep " + searchContent + fmt.Println("scriptStr: ", scriptStr) return strings.Split(util.RunScript(scriptStr), "\n")[0] } -- Gitblit v1.8.0