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
This commit is contained in:
psychon
2008-08-25 14:39:06 +00:00
parent adcca250e1
commit 840d1ba15a
+22 -22
View File
@@ -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 <User> 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 <User> section of your config:");
CUtils::PrintMessage("Pass = md5#" + sHash + "#" + sSalt + "#");
return 0;
}
if (!pZNC->ParseConfig(sConfig)) {
CUtils::PrintError("Unrecoverable config error.");
delete pZNC;