From b04e827ae6c3c41de9ca7c16373e143f06797ce1 Mon Sep 17 00:00:00 2001 From: Till Brehm <tbrehm@ispconfig.org> Date: Wed, 09 Jul 2014 06:50:10 -0400 Subject: [PATCH] - Cleaned up autoinstall code - Added autoinstall for centos, opensuse and gentoo - Added ini style config autoinstall option - Autoinstall sample configuration files are now in docs folder - Removed old autoupdate file --- install/dist/lib/gentoo.lib.php | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/install/dist/lib/gentoo.lib.php b/install/dist/lib/gentoo.lib.php index b14cffe..9a0d7c9 100644 --- a/install/dist/lib/gentoo.lib.php +++ b/install/dist/lib/gentoo.lib.php @@ -119,9 +119,13 @@ //* Create the SSL certificate if (!stristr($options, 'dont-create-certs')) { - $command = 'cd '.$config_dir.'; ' - .'openssl req -new -outform PEM -out smtpd.cert -newkey rsa:2048 -nodes -keyout smtpd.key -keyform PEM -days 365 -x509'; - exec($command); + if(AUTOINSTALL){ + $command = 'cd '.$config_dir.'; ' + ."openssl req -new -subj '/C=".$autoinstall['ssl_cert_country']."/ST=".$autoinstall['ssl_cert_state']."/L=".$autoinstall['ssl_cert_locality']."/O=".$autoinstall['ssl_cert_organisation']."/OU=".$autoinstall['ssl_cert_organisation_unit']."/CN=".$autoinstall['ssl_cert_common_name']."' -outform PEM -out smtpd.cert -newkey rsa:4096 -nodes -keyout smtpd.key -keyform PEM -days 3650 -x509"; + } else { + $command = 'cd '.$config_dir.'; ' + ."openssl req -new -subj '/C=".escapeshellcmd($autoinstall['ssl_cert_country'])."/ST=".escapeshellcmd($autoinstall['ssl_cert_state'])."/L=".escapeshellcmd($autoinstall['ssl_cert_locality'])."/O=".escapeshellcmd($autoinstall['ssl_cert_organisation'])."/OU=".escapeshellcmd($autoinstall['ssl_cert_organisation_unit'])."/CN=".escapeshellcmd($autoinstall['ssl_cert_common_name'])."' -outform PEM -out smtpd.cert -newkey rsa:4096 -nodes -keyout smtpd.key -keyform PEM -days 3650 -x509"; + } $command = 'chmod o= '.$config_dir.'/smtpd.key'; caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); -- Gitblit v1.9.1