From d387fddbb1d9ff4027c1fce49b3776cbc767568e Mon Sep 17 00:00:00 2001 From: VIVIMAN Date: Fri, 6 May 2022 17:55:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A6=E5=8F=91=E6=96=B0=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data_func/go_to_tray/demo04/main.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/golang_learn/data_func/go_to_tray/demo04/main.go b/golang_learn/data_func/go_to_tray/demo04/main.go index 16868d0..3bc278a 100644 --- a/golang_learn/data_func/go_to_tray/demo04/main.go +++ b/golang_learn/data_func/go_to_tray/demo04/main.go @@ -19,7 +19,7 @@ func mkFile() { err := os.Mkdir("shell", os.ModePerm) if err == nil { toFile("./shell/startCX.bat", "net start GWY20_Tomcat") - toFile("./shell/stopCX.bat", "net stop GWY20_Tomcat") + toFile("./shell/stopCX.bat", "taskkill /f /fi \"SERVICES eq GWY20_Tomcat\"") toFile("./shell/startDB.bat", "net start GWY20_Mysql") toFile("./shell/stopDB.bat", "net stop GWY20_Mysql") toFile("./shell/startCX.sh", "service qggwy.service start") @@ -147,13 +147,13 @@ func OpenServe(isDb bool) error { cmd = "cmd" args = []string{"/c", "cd", "shell", "&&", "startDB.bat"} } else { - cmd = "/bin/sh" - args = []string{"-c", "cd", "shell", "&&", "startDB.sh"} + cmd = "cmd" + args = []string{"/c", "cd", "shell", "&&", "startCX.bat"} } default: // "linux", "freebsd", "openbsd", "netbsd", "mac" if isDb { - cmd = "cmd" - args = []string{"/c", "cd", "shell", "&&", "startCX.bat"} + cmd = "/bin/sh" + args = []string{"-c", "cd", "shell", "&&", "startDB.sh"} } else { cmd = "/bin/sh" args = []string{"-c", "cd", "shell", "&&", "startCX.sh"} @@ -175,13 +175,13 @@ func CloseServe(isDb bool) error { cmd = "cmd" args = []string{"/c", "cd", "shell", "&&", "stopDB.bat"} } else { - cmd = "/bin/sh" - args = []string{"-c", "cd", "shell", "&&", "stopDB.sh"} + cmd = "cmd" + args = []string{"/c", "cd", "shell", "&&", "stopCX.bat"} } default: // "linux", "freebsd", "openbsd", "netbsd", "mac" if isDb { - cmd = "cmd" - args = []string{"/c", "cd", "shell", "&&", "stopCX.bat"} + cmd = "/bin/sh" + args = []string{"-c", "cd", "shell", "&&", "stopDB.sh"} } else { cmd = "/bin/sh" args = []string{"-c", "cd", "shell", "&&", "stopCX.sh"}