fix: commandShell condition, Join
This commit is contained in:
parent
57d151e9b2
commit
0af8d93f4d
@ -37,7 +37,7 @@ func init() {
|
|||||||
path, err = exec.LookPath("sh")
|
path, err = exec.LookPath("sh")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err == nil {
|
||||||
commandShell = []string{path, "-c"}
|
commandShell = []string{path, "-c"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -105,7 +105,7 @@ func command(c *fb.Context, w http.ResponseWriter, r *http.Request) (int, error)
|
|||||||
buff := new(bytes.Buffer)
|
buff := new(bytes.Buffer)
|
||||||
|
|
||||||
if len(commandShell) != 0 {
|
if len(commandShell) != 0 {
|
||||||
command = append(commandShell, command...)
|
command = append(commandShell, strings.Join(command, " "))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sets up the command executation.
|
// Sets up the command executation.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user