Add a possibility (not an "option") to disable launch after --makeconf

See #257
This commit is contained in:
Alexey Sokolov
2015-08-24 21:22:14 +01:00
parent 3a3155f9d5
commit 9688727f32

View File

@@ -873,7 +873,21 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) {
CUtils::PrintMessage("");
File.UnLock();
return bFileOpen && CUtils::GetBoolInput("Launch ZNC now?", true);
bool bWantLaunch = bFileOpen;
if (bWantLaunch) {
// "export ZNC_NO_LAUNCH_AFTER_MAKECONF=1" would cause znc --makeconf to not offer immediate launch.
// Useful for distros which want to create config when znc package is installed.
// See https://github.com/znc/znc/pull/257
char* szNoLaunch = getenv("ZNC_NO_LAUNCH_AFTER_MAKECONF");
if (szNoLaunch && *szNoLaunch == '1') {
bWantLaunch = false;
}
}
if (bWantLaunch) {
bWantLaunch = CUtils::GetBoolInput("Launch ZNC now?", true);
}
return bWantLaunch;
}
void CZNC::BackupConfigOnce(const CString& sSuffix) {