Removed: Content migration (packet subdomain)

This commit is contained in:
Michael Hierweck 2012-10-30 13:56:40 +01:00
parent 43cee5e34d
commit abd74a422f

View File

@ -72,9 +72,6 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
templateVars.put("DOMAIN", domName); templateVars.put("DOMAIN", domName);
templateVars.put("USER_NAME", domUser.getComment()); templateVars.put("USER_NAME", domUser.getComment());
mainProcessor.appendProcessor(hiveName, createApacheVHostSetupProcessor(em, dom, templateVars), "Setup Apache VHost"); mainProcessor.appendProcessor(hiveName, createApacheVHostSetupProcessor(em, dom, templateVars), "Setup Apache VHost");
if (dom.isPacDomain()) {
mainProcessor.appendProcessor(hiveName, createMovePacDomainContent(em, dom), "Move pac domain content");
}
return mainProcessor; return mainProcessor;
} }
@ -372,43 +369,6 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
return vhostDelProcessor; return vhostDelProcessor;
} }
private Processor createMovePacDomainContent(EntityManager em, Domain dom) {
Pac pac = dom.getUser().getPac();
String pacName = pac.getName();
String pacDir = "/home/pacs/" + pacName;
String domDir = pacDir + "/doms/" + pacName + ".hostsharing.net";
String[] sourceDirs = new String[] { "web", "web-ssl", "cgi", "cgi-ssl", "fastcgi", "fastcgi-ssl" } ;
String[] targetDirs = new String[] { "htdocs", "htdocs-ssl", "cgi", "cgi-ssl", "fastcgi", "fastcgi-ssl" } ;
CompoundProcessor processor = new CompoundProcessor();
for (int idx = 0; idx < targetDirs.length; idx++) {
processor.appendProcessor(
new ShellProcessor("rm -rf " + domDir + "/" + targetDirs[idx]));
}
for (int idx = 0; idx < sourceDirs.length; idx++) {
processor.appendProcessor(
new ShellProcessor("shopt -s dotglob && ls " + pacDir + "/" + sourceDirs[idx] + " >/dev/null 2>&1" +
" && mv " + pacDir + "/" + sourceDirs[idx] + " " + domDir + "/" + targetDirs[idx] +
" || echo 'directory " + pacDir + "/" + sourceDirs[idx] + " not found'"));
}
processor.appendProcessor(
new ShellProcessor("test -L " + domDir + "/htdocs" +
" && test $( stat -c '%N' " + domDir + "/htdocs |sed -e\"s/[\\`']//g\" |cut -d ' ' -f 3 ) = web-ssl " +
" && cd " + domDir +
" && rm " + domDir + "/htdocs" +
" && ln -sf htdocs-ssl htdocs" +
" && chown -h " + pacName + ":" + pacName + " " + domDir + "/htdocs" +
" || echo 'link htdocs not found'"));
processor.appendProcessor(
new ShellProcessor("test -L " + domDir + "/htdocs-ssl" +
" && test $( stat -c '%N' " + domDir + "/htdocs-ssl |sed -e\"s/[\\`']//g\" |cut -d ' ' -f 3 ) = web " +
" && cd " + domDir +
" && rm " + domDir + "/htdocs-ssl" +
" && ln -sf htdocs htdocs-ssl" +
" && chown -h " + pacName + ":" + pacName + " " + domDir + "/htdocs-ssl" +
" || echo 'link htdocs-ssl not found'"));
return processor;
}
private String selectVHostTemplate(Domain dom) { private String selectVHostTemplate(Domain dom) {
String domName = dom.getName(); String domName = dom.getName();
UnixUser user = dom.getUser(); UnixUser user = dom.getUser();