Fix nginx command env variable reference
This commit is contained in:
parent
351248fabb
commit
a981862ff2
1 changed files with 9 additions and 1 deletions
|
@ -18,6 +18,7 @@ package controller
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
|
@ -92,9 +93,16 @@ type NginxCommand struct {
|
||||||
// NewNginxCommand returns a new NginxCommand from which path
|
// NewNginxCommand returns a new NginxCommand from which path
|
||||||
// has been detected from environment variable NGINX_BINARY or default
|
// has been detected from environment variable NGINX_BINARY or default
|
||||||
func NewNginxCommand() NginxCommand {
|
func NewNginxCommand() NginxCommand {
|
||||||
return NginxCommand{
|
command := NginxCommand{
|
||||||
Binary: defBinary,
|
Binary: defBinary,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binary := os.Getenv("NGINX_BINARY")
|
||||||
|
if binary != "" {
|
||||||
|
command.Binary = binary
|
||||||
|
}
|
||||||
|
|
||||||
|
return command
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExecCommand instanciates an exec.Cmd object to call nginx program
|
// ExecCommand instanciates an exec.Cmd object to call nginx program
|
||||||
|
|
Loading…
Reference in a new issue