fix errors in virtual.conf

This commit is contained in:
Peter Hormanns 2012-10-16 17:35:14 +02:00
parent d5b27e5a59
commit 787a086baf

View File

@ -60,18 +60,17 @@ public class PacProcessorFactory implements EntityProcessorFactory {
new CreateFileProcessor("/de/hsadmin/mods/pac/httpd-virtual.jtpl",
new HashMap<String, String>(), pacValuesList.iterator(),
"/etc/apache2/virtual.conf.tmp", "root", "root", "644", true),
new ShellProcessor("for PEM in $( cat virtual.conf.tmp | grep SSLCertificateFile | cut -c24- ); do " +
new ShellProcessor("for PEM in $( cat /etc/apache2/virtual.conf.tmp | grep SSLCertificateFile | cut -c24- ); do " +
"ls $PEM >/dev/null 2>&1 || ( " +
" sed -i \"/SSLCertificateFile.*${PEM:18}/c \\\n" +
"\\ \\ \\ \\ SSLCertificateFile \\/etc\\/apache2\\/pems\\/default.pem\" virtual.conf.tmp && " +
"\\ \\ \\ \\ SSLCertificateFile \\/etc\\/apache2\\/pems\\/default.pem\" /etc/apache2/virtual.conf.tmp && " +
" sed -i \"/SSLCertificateChainFile.*${PEM:18:5}.chain.pem/c \\\n" +
"\\ \\ \\ \\ SSLCertificateChainFile \\/etc\\/apache2\\/pems\\/default.chain.pem\" virtual.conf.tmp " +
"\\ \\ \\ \\ SSLCertificateChainFile \\/etc\\/apache2\\/pems\\/default.chain.pem\" /etc/apache2/virtual.conf.tmp " +
"); " +
"done"),
new ShellProcessor("for PEM in $( cat virtual.conf.tmp | grep SSLCertificateChainFile | cut -c24- ); do " +
new ShellProcessor("for PEM in $( /etc/apache2/cat virtual.conf.tmp | grep SSLCertificateChainFile | cut -c24- ); do " +
"ls $PEM >/dev/null 2>&1 || " +
" sed -i \"/SSLCertificateChainFile.*${PEM:18:5}.chain.pem/d \" virtual.conf.tmp " +
"); " +
" sed -i \"/SSLCertificateChainFile.*${PEM:18:5}.chain.pem/d \" /etc/apache2/virtual.conf.tmp ; " +
"done"),
new ShellProcessor("(diff -q /etc/apache2/virtual.conf.tmp /etc/apache2/virtual.conf"
+ " && rm /etc/apache2/virtual.conf.tmp )"