mirror of
https://github.com/status-im/consul.git
synced 2025-01-09 13:26:07 +00:00
agent: Use SHELL if provided. Fixes #237.
This commit is contained in:
parent
333095691e
commit
70eb59c63e
@ -3,6 +3,7 @@ package agent
|
|||||||
import (
|
import (
|
||||||
"math"
|
"math"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
@ -52,6 +53,9 @@ func ExecScript(script string) (*exec.Cmd, error) {
|
|||||||
shell = "/bin/sh"
|
shell = "/bin/sh"
|
||||||
flag = "-c"
|
flag = "-c"
|
||||||
}
|
}
|
||||||
|
if other := os.Getenv("SHELL"); other != "" {
|
||||||
|
shell = other
|
||||||
|
}
|
||||||
cmd := exec.Command(shell, flag, script)
|
cmd := exec.Command(shell, flag, script)
|
||||||
return cmd, nil
|
return cmd, nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user