fix error user -> username

This commit is contained in:
Peter Hormanns 2019-10-23 12:50:58 +02:00
parent 85ea7c6544
commit 90d6ce1b6f

View File

@ -350,34 +350,37 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
}
private Processor createApacheVHostDeleteProcessor(Domain dom) {
final String domName = dom.getName();
final int level = domName.split("\\.").length;
final String domname = dom.getName();
final int level = domname.split("\\.").length;
final String linkPrefix = Integer.toString(100 - level);
final UnixUser user = dom.getUser();
final String homedir = user.getHomedir();
if (dom.isPacDomain()) {
final String username = user.getName();
return
new ShellProcessor("rm -f /home/doms/" + domName +
" && rm -f /etc/apache2/sites-enabled/" + linkPrefix + "-" + domName +
" && rm -f /etc/apache2/sites-available/" + domName +
" && rm -f /etc/apache2/pems-enabled/" + domName + ".crt" +
" && rm -f /etc/apache2/pems-enabled/" + domName + ".key" +
" && rm -f /etc/apache2/pems-enabled/" + domName + ".chain" +
" && rm -f /etc/apache2/pems-generated/" + domName + ".crt" +
" && rm -f /etc/apache2/pems-generated/" + domName + ".key" +
" && rm -f /etc/apache2/pems-generated/" + domName + ".chain" +
" && chown -R " + dom.getUser() + ":" + dom.getUser() + " " + dom.getUser().getHomedir() + "/doms/" + domName +
new ShellProcessor("rm -f /home/doms/" + domname +
" && rm -f /etc/apache2/sites-enabled/" + linkPrefix + "-" + domname +
" && rm -f /etc/apache2/sites-available/" + domname +
" && rm -f /etc/apache2/pems-enabled/" + domname + ".crt" +
" && rm -f /etc/apache2/pems-enabled/" + domname + ".key" +
" && rm -f /etc/apache2/pems-enabled/" + domname + ".chain" +
" && rm -f /etc/apache2/pems-generated/" + domname + ".crt" +
" && rm -f /etc/apache2/pems-generated/" + domname + ".key" +
" && rm -f /etc/apache2/pems-generated/" + domname + ".chain" +
" && chown -R " + username + ":" + username + " " + homedir + "/doms/" + domname +
" && invoke-rc.d apache2 reload >/dev/null 2>&1");
}
return
new ShellProcessor("rm -f /home/doms/" + domName +
" && rm -f /etc/apache2/sites-enabled/" + linkPrefix + "-" + domName +
" && rm -f /etc/apache2/sites-available/" + domName +
" && rm -f /etc/apache2/pems-enabled/" + domName + ".crt" +
" && rm -f /etc/apache2/pems-enabled/" + domName + ".key" +
" && rm -f /etc/apache2/pems-enabled/" + domName + ".chain" +
" && rm -f /etc/apache2/pems-generated/" + domName + ".crt" +
" && rm -f /etc/apache2/pems-generated/" + domName + ".key" +
" && rm -f /etc/apache2/pems-generated/" + domName + ".chain" +
" && rm -rf " + dom.getUser().getHomedir() + "/doms/" + domName +
new ShellProcessor("rm -f /home/doms/" + domname +
" && rm -f /etc/apache2/sites-enabled/" + linkPrefix + "-" + domname +
" && rm -f /etc/apache2/sites-available/" + domname +
" && rm -f /etc/apache2/pems-enabled/" + domname + ".crt" +
" && rm -f /etc/apache2/pems-enabled/" + domname + ".key" +
" && rm -f /etc/apache2/pems-enabled/" + domname + ".chain" +
" && rm -f /etc/apache2/pems-generated/" + domname + ".crt" +
" && rm -f /etc/apache2/pems-generated/" + domname + ".key" +
" && rm -f /etc/apache2/pems-generated/" + domname + ".chain" +
" && rm -rf " + homedir + "/doms/" + domname +
" && invoke-rc.d apache2 reload >/dev/null 2>&1");
}