From 70eb59c63e2205ede37fee56b84cfa21b3c15517 Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Fri, 22 Aug 2014 12:47:58 -0700 Subject: [PATCH] agent: Use SHELL if provided. Fixes #237. --- command/agent/util.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/command/agent/util.go b/command/agent/util.go index 16b3b01907..e2fdf44abd 100644 --- a/command/agent/util.go +++ b/command/agent/util.go @@ -3,6 +3,7 @@ package agent import ( "math" "math/rand" + "os" "os/exec" "runtime" "time" @@ -52,6 +53,9 @@ func ExecScript(script string) (*exec.Cmd, error) { shell = "/bin/sh" flag = "-c" } + if other := os.Getenv("SHELL"); other != "" { + shell = other + } cmd := exec.Command(shell, flag, script) return cmd, nil }