Browse Source

触发新脚本控制

master
VIVIMAN 3 years ago
parent
commit
d387fddbb1
  1. 18
      golang_learn/data_func/go_to_tray/demo04/main.go

18
golang_learn/data_func/go_to_tray/demo04/main.go

@ -19,7 +19,7 @@ func mkFile() {
err := os.Mkdir("shell", os.ModePerm) err := os.Mkdir("shell", os.ModePerm)
if err == nil { if err == nil {
toFile("./shell/startCX.bat", "net start GWY20_Tomcat") 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/startDB.bat", "net start GWY20_Mysql")
toFile("./shell/stopDB.bat", "net stop GWY20_Mysql") toFile("./shell/stopDB.bat", "net stop GWY20_Mysql")
toFile("./shell/startCX.sh", "service qggwy.service start") toFile("./shell/startCX.sh", "service qggwy.service start")
@ -147,13 +147,13 @@ func OpenServe(isDb bool) error {
cmd = "cmd" cmd = "cmd"
args = []string{"/c", "cd", "shell", "&&", "startDB.bat"} args = []string{"/c", "cd", "shell", "&&", "startDB.bat"}
} else { } else {
cmd = "/bin/sh" cmd = "cmd"
args = []string{"-c", "cd", "shell", "&&", "startDB.sh"} args = []string{"/c", "cd", "shell", "&&", "startCX.bat"}
} }
default: // "linux", "freebsd", "openbsd", "netbsd", "mac" default: // "linux", "freebsd", "openbsd", "netbsd", "mac"
if isDb { if isDb {
cmd = "cmd" cmd = "/bin/sh"
args = []string{"/c", "cd", "shell", "&&", "startCX.bat"} args = []string{"-c", "cd", "shell", "&&", "startDB.sh"}
} else { } else {
cmd = "/bin/sh" cmd = "/bin/sh"
args = []string{"-c", "cd", "shell", "&&", "startCX.sh"} args = []string{"-c", "cd", "shell", "&&", "startCX.sh"}
@ -175,13 +175,13 @@ func CloseServe(isDb bool) error {
cmd = "cmd" cmd = "cmd"
args = []string{"/c", "cd", "shell", "&&", "stopDB.bat"} args = []string{"/c", "cd", "shell", "&&", "stopDB.bat"}
} else { } else {
cmd = "/bin/sh" cmd = "cmd"
args = []string{"-c", "cd", "shell", "&&", "stopDB.sh"} args = []string{"/c", "cd", "shell", "&&", "stopCX.bat"}
} }
default: // "linux", "freebsd", "openbsd", "netbsd", "mac" default: // "linux", "freebsd", "openbsd", "netbsd", "mac"
if isDb { if isDb {
cmd = "cmd" cmd = "/bin/sh"
args = []string{"/c", "cd", "shell", "&&", "stopCX.bat"} args = []string{"-c", "cd", "shell", "&&", "stopDB.sh"}
} else { } else {
cmd = "/bin/sh" cmd = "/bin/sh"
args = []string{"-c", "cd", "shell", "&&", "stopCX.sh"} args = []string{"-c", "cd", "shell", "&&", "stopCX.sh"}

Loading…
Cancel
Save