mirror of
https://github.com/znc/znc.git
synced 2026-05-01 19:12:31 +02:00
Added prompt for pem file generation
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@557 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
23
main.cpp
23
main.cpp
@@ -138,28 +138,7 @@ int main(int argc, char** argv, char** envp) {
|
||||
if (bMakePem) {
|
||||
CZNC* pZNC = &CZNC::Get();
|
||||
pZNC->InitDirs("");
|
||||
CString sPemFile = pZNC->GetPemLocation();
|
||||
|
||||
CUtils::PrintAction("Writing Pem file [" + sPemFile + "]");
|
||||
|
||||
if (CFile::Exists(sPemFile)) {
|
||||
CUtils::PrintStatus(false, "File already exists");
|
||||
delete pZNC;
|
||||
return 1;
|
||||
}
|
||||
|
||||
FILE *f = fopen(sPemFile.c_str(), "w");
|
||||
|
||||
if (!f) {
|
||||
CUtils::PrintStatus(false, "Unable to open");
|
||||
delete pZNC;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
CUtils::GenerateCert(f, bEncPem);
|
||||
fclose(f);
|
||||
|
||||
CUtils::PrintStatus(true);
|
||||
pZNC->WritePemFile();
|
||||
|
||||
delete pZNC;
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user