fix: commandShell condition, Join

This commit is contained in:
1138-4EB 2018-08-20 22:58:54 +01:00
parent 57d151e9b2
commit 0af8d93f4d

View File

@ -37,7 +37,7 @@ func init() {
path, err = exec.LookPath("sh")
}
if err != nil {
if err == nil {
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)
if len(commandShell) != 0 {
command = append(commandShell, command...)
command = append(commandShell, strings.Join(command, " "))
}
// Sets up the command executation.