This commit is contained in:
Liang Ding 2015-10-26 13:18:36 +08:00
parent 0780cdb04f
commit 42093ebfc1
1 changed files with 5 additions and 7 deletions

View File

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