This commit is contained in:
Liang Ding 2015-09-08 09:37:19 +08:00
parent 78ac45ae24
commit 5259b54304
1 changed files with 13 additions and 11 deletions

View File

@ -195,19 +195,16 @@ func initWide(confPath, confIP, confPort, confServer, confLogLevel, confStaticSe
}
// IP
ip, err := util.Net.LocalIP()
if err != nil {
logger.Error(err)
os.Exit(-1)
}
logger.Debugf("${ip} [%s]", ip)
Docker = confDocker
ip := ""
if "" != confIP {
ip = confIP
} else {
ip, err = util.Net.LocalIP()
if nil != err {
logger.Error(err)
os.Exit(-1)
}
}
Wide.IP = strings.Replace(Wide.IP, "${ip}", ip, 1)
@ -216,6 +213,11 @@ func initWide(confPath, confIP, confPort, confServer, confLogLevel, confStaticSe
Wide.Port = confPort
}
logger.Debugf("${ip} [%s]", ip)
// Docker flag
Docker = confDocker
// Server
Wide.Server = strings.Replace(Wide.Server, "{IP}", Wide.IP, 1)
Wide.Server = strings.Replace(Wide.Server, "{Port}", Wide.Port, 1)