Fix bei der Loeschung eines Links in /etc/apache2/sites-enabled

This commit is contained in:
Peter Hormanns 2012-06-15 14:37:21 +00:00
parent 389c9f23c4
commit 8db019e5eb

View File

@ -273,11 +273,13 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
private Processor createApacheVHostDeleteProcessor(Domain dom) {
String domName = dom.getName();
int level = domName.split("\\.").length;
String linkPrefix = Integer.toString(100 - level);
Processor vhostDelProcessor =
new ShellProcessor("rm /home/doms/" + domName +
" && rm -rf " + dom.getUser().getHomedir() + "/doms/" + domName +
" && rm /etc/apache2/sites-enabled/" + linkPrefix + "-" + domName +
" && rm /etc/apache2/sites-available/" + domName +
" && rm /etc/apache2/sites-*/`ls -1 /etc/apache2/sites-enabled/ | egrep \"^[01]+-" + domName + "$\"`" +
" && rm -rf " + dom.getUser().getHomedir() + "/doms/" + domName +
" && invoke-rc.d apache2 reload >/dev/null 2>&1");
return vhostDelProcessor;
}