agent: Use SHELL if provided. Fixes #237.

This commit is contained in:
Armon Dadgar 2014-08-22 12:47:58 -07:00
parent 333095691e
commit 70eb59c63e
1 changed files with 4 additions and 0 deletions

View File

@ -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
}