mirror of https://github.com/status-im/consul.git
18 lines
320 B
Go
18 lines
320 B
Go
// +build !windows
|
|
|
|
package agent
|
|
|
|
import (
|
|
"os"
|
|
"os/exec"
|
|
)
|
|
|
|
// ExecScript returns a command to execute a script through a shell.
|
|
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
|
|
}
|