From 840d1ba15a433326b0976e636b5e31de6e68aae1 Mon Sep 17 00:00:00 2001 From: psychon Date: Mon, 25 Aug 2008 14:39:06 +0000 Subject: [PATCH] Move some code around No actual changes in here, just some preparation. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1170 726aef4b-f618-498e-8847-2d620e286838 --- main.cpp | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/main.cpp b/main.cpp index 3836832d..05030ef7 100644 --- a/main.cpp +++ b/main.cpp @@ -135,6 +135,28 @@ int main(int argc, char** argv) { CZNC* pZNC = &CZNC::Get(); pZNC->InitDirs(((argc) ? argv[0] : ""), sDataDir); +#ifdef HAVE_LIBSSL + if (bMakePem) { + pZNC->WritePemFile(bEncPem); + + delete pZNC; + return 0; + } + if (bEncPem && !bMakePem) { + CUtils::PrintError("--encrypt-pem should be used along with --makepem."); + return 1; + } + +#endif /* HAVE_LIBSSL */ + if (bMakePass) { + CString sSalt; + CString sHash = CUtils::GetSaltedHashPass(sSalt); + CUtils::PrintMessage("Use this in the section of your config:"); + CUtils::PrintMessage("Pass = md5#" + sHash + "#" + sSalt + "#"); + + return 0; + } + if (bMakeConf) { if (pZNC->WriteNewConfig(sConfig)) { char const* args[5]; @@ -174,28 +196,6 @@ int main(int argc, char** argv) { return 0; } -#ifdef HAVE_LIBSSL - if (bMakePem) { - pZNC->WritePemFile(bEncPem); - - delete pZNC; - return 0; - } - if (bEncPem && !bMakePem) { - CUtils::PrintError("--encrypt-pem should be used along with --makepem."); - return 1; - } - -#endif /* HAVE_LIBSSL */ - if (bMakePass) { - CString sSalt; - CString sHash = CUtils::GetSaltedHashPass(sSalt); - CUtils::PrintMessage("Use this in the section of your config:"); - CUtils::PrintMessage("Pass = md5#" + sHash + "#" + sSalt + "#"); - - return 0; - } - if (!pZNC->ParseConfig(sConfig)) { CUtils::PrintError("Unrecoverable config error."); delete pZNC;