上传命令优化
This commit is contained in:
parent
1b50ddaabd
commit
38a431a552
@ -186,6 +186,7 @@ func startService(sseting *core.ServiceSttings) (err error) {
|
||||
cmd *exec.Cmd
|
||||
command string
|
||||
confpath string = fmt.Sprintf("./conf/%s.yaml", sseting.Id)
|
||||
output []byte
|
||||
)
|
||||
switch sseting.Type {
|
||||
case comm.Service_Gateway: //网关服务
|
||||
@ -203,7 +204,10 @@ func startService(sseting *core.ServiceSttings) (err error) {
|
||||
}
|
||||
log.Debug("启动外部命令", log.Field{Key: "cmd", Value: command})
|
||||
cmd = exec.Command("/bin/bash", "-c", command)
|
||||
err = cmd.Run()
|
||||
if output, err = cmd.CombinedOutput(); err != nil {
|
||||
return
|
||||
}
|
||||
log.Debug(string(output))
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user