From 465aa31a061cdce731cf2cf477769af3d19dc6c5 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 19 Sep 2006 10:32:20 +0000 Subject: Skip certificate generation if we're running non-interactive git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5288 e03df62e-2008-0410-955e-edbf42e46eb7 --- configure | 76 +++++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 31 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 86dbc444e..eca2021ed 100755 --- a/configure +++ b/configure @@ -875,13 +875,15 @@ if ($config{USE_GNUTLS} eq "y") { chdir("../.."); } getmodules(); - $failed = 0; - open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1; - close(TMP); - open(TMP, "<$config{CONFIG_DIR}/cert.pem") or $failed = 1; - close(TMP); - if ($failed) { - print "SSL Certificates Not found, Generating.. \n\n + if ($interactive) + { + $failed = 0; + open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1; + close(TMP); + open(TMP, "<$config{CONFIG_DIR}/cert.pem") or $failed = 1; + close(TMP); + if ($failed) { + print "SSL Certificates Not found, Generating.. \n\n ************************************************************* * Generating the Private Key may take some time, go grab a * * Coffee. Even better, to generate some more entropy if it * @@ -889,15 +891,20 @@ if ($config{USE_GNUTLS} eq "y") { * few times and get that HD going :) Then answer the * * Questions which follow. If you are unsure, just hit enter * *************************************************************\n\n"; - system("certtool --generate-privkey --outfile key.pem"); - system("certtool --generate-self-signed --load-privkey key.pem --outfile cert.pem"); - print "\nCertificate generation complete, copying to config directory... "; - system("mv key.pem $config{CONFIG_DIR}/key.pem"); - system("mv cert.pem $config{CONFIG_DIR}/cert.pem"); - print "Done.\n\n"; - } else { - print "SSL Certificates found, skipping.\n\n" - } + system("certtool --generate-privkey --outfile key.pem"); + system("certtool --generate-self-signed --load-privkey key.pem --outfile cert.pem"); + print "\nCertificate generation complete, copying to config directory... "; + system("mv key.pem $config{CONFIG_DIR}/key.pem"); + system("mv cert.pem $config{CONFIG_DIR}/cert.pem"); + print "Done.\n\n"; + } else { + print "SSL Certificates found, skipping.\n\n" + } + } + else + { + print "Skipping SSL certificate generation\nin non-interactive mode.\n\n"; + } } elsif ($config{USE_OPENSSL} eq "y") { $failed = 0; open(TMP, "