From bed5c86d8ecc30eb8ec34b192a0b5b2e2d9ff4fd Mon Sep 17 00:00:00 2001 From: Gunhee Lee Date: Sun, 17 Jan 2021 15:09:06 +0900 Subject: [PATCH] misc --- scouterx/conf/configure.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/scouterx/conf/configure.go b/scouterx/conf/configure.go index 63f22a8..bb11182 100644 --- a/scouterx/conf/configure.go +++ b/scouterx/conf/configure.go @@ -140,10 +140,18 @@ func (conf *Configure) run() { } func getConfFilePath() string { - path := util.GetScouterPath() - confPath := filepath.Join(path, "conf") - util.MakeDir(confPath) - return filepath.Join(path, "conf", "scouter.conf") + scouterConfFile := os.Getenv("SCOUTER_CONFIG") + if scouterConfFile == "" { + scouterConfFile = os.Getenv("scouter.config") + } + if scouterConfFile == "" { + path := util.GetScouterPath() + confPath := filepath.Join(path, "conf") + util.MakeDir(confPath) + scouterConfFile = filepath.Join(path, "conf", "scouter.conf") + } + + return scouterConfFile } func (conf *Configure) SetTrace(mode bool) {