You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/agent/util_other.go

18 lines
303 B

// +build !windows
package agent
import (
"os"
"os/exec"
)
// ExecScript returns a command to execute a script
func ExecScript(script string) (*exec.Cmd, error) {
shell := "/bin/sh"
if other := os.Getenv("SHELL"); other != "" {
shell = other
}
return exec.Command(shell, "-c", script), nil
}