mirror of
https://github.com/znc/znc.git
synced 2026-07-06 09:51:25 +02:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user