上传命令优化

This commit is contained in:
liwei1dao 2022-09-21 15:32:24 +08:00
parent 1b50ddaabd
commit 38a431a552

View File

@ -186,6 +186,7 @@ func startService(sseting *core.ServiceSttings) (err error) {
cmd *exec.Cmd cmd *exec.Cmd
command string command string
confpath string = fmt.Sprintf("./conf/%s.yaml", sseting.Id) confpath string = fmt.Sprintf("./conf/%s.yaml", sseting.Id)
output []byte
) )
switch sseting.Type { switch sseting.Type {
case comm.Service_Gateway: //网关服务 case comm.Service_Gateway: //网关服务
@ -203,7 +204,10 @@ func startService(sseting *core.ServiceSttings) (err error) {
} }
log.Debug("启动外部命令", log.Field{Key: "cmd", Value: command}) log.Debug("启动外部命令", log.Field{Key: "cmd", Value: command})
cmd = exec.Command("/bin/bash", "-c", command) cmd = exec.Command("/bin/bash", "-c", command)
err = cmd.Run() if output, err = cmd.CombinedOutput(); err != nil {
return
}
log.Debug(string(output))
return return
} }