Made --makepem use GetPemLocation() and print a message on success

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@96 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2005-04-04 04:21:55 +00:00
parent 525f0c140f
commit 097b281ed3
+13 -3
View File
@@ -97,13 +97,24 @@ int main(int argc, char** argv) {
#ifdef HAVE_LIBSSL
if ( bMakePem ) {
FILE *f = fopen( "znc.pem", "w" );
CZNC* pZNC = CZNC::New();
pZNC->InitDirs("");
string sPemFile = pZNC->GetPemLocation();
FILE *f = fopen( sPemFile.c_str(), "w" );
if ( !f ) {
cerr << "Unable to open znc.pem!" << endl;
cerr << "Unable to open pem file [" << sPemFile << "]" << endl;
delete pZNC;
return( 1 );
}
CUtils::GenerateCert( f, bEncPem );
fclose( f );
cout << "Wrote pem file to [" << sPemFile << "]" << endl;
delete pZNC;
return( 0 );
}
#endif /* HAVE_LIBSSL */
@@ -116,7 +127,6 @@ int main(int argc, char** argv) {
}
CZNC* pZNC = CZNC::New();
pZNC->InitDirs(((argc) ? argv[0] : ""));
if (!pZNC->ParseConfig(sConfig)) {