From 9688727f3262c15dee0016c33c8dbf18bb4feb25 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Mon, 24 Aug 2015 21:22:14 +0100 Subject: [PATCH] Add a possibility (not an "option") to disable launch after --makeconf See #257 --- src/znc.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/znc.cpp b/src/znc.cpp index c1f0d2fa..084145ef 100644 --- a/src/znc.cpp +++ b/src/znc.cpp @@ -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) {