diff --git a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java index 7d65e53..67af241 100644 --- a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java @@ -60,18 +60,17 @@ public class PacProcessorFactory implements EntityProcessorFactory { new CreateFileProcessor("/de/hsadmin/mods/pac/httpd-virtual.jtpl", new HashMap(), 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 )"