* rename i2p.conf -> i2pd.conf, add detection of old config

This commit is contained in:
hagen 2016-03-28 00:00:00 +00:00
parent 0bb89de821
commit 8437d45866
6 changed files with 16 additions and 8 deletions

View file

@ -69,11 +69,19 @@ namespace i2p
i2p::fs::Init();
datadir = i2p::fs::GetDataDir();
if (config == "")
// TODO: drop old name detection in v2.8.0
if (config == "")
{
config = i2p::fs::DataDirPath("i2p.conf");
// use i2p.conf only if exists
if (!i2p::fs::Exists (config)) config = ""; /* reset */
if (i2p::fs::Exists (config)) {
LogPrint(eLogWarning, "Daemon: please rename i2p.conf to i2pd.conf here: ", config);
} else {
config = i2p::fs::DataDirPath("i2pd.conf");
if (!i2p::fs::Exists (config)) {
// use i2pd.conf only if exists
config = ""; /* reset */
}
}
}
i2p::config::ParseConfig(config);