}
}
private void doInstall() {
logger.l1("[+] Creating database data");
SystemInfo info = MainHandler.getCurrentInstance().getInfo();
// robots
Robot areafix = new Robot();
areafix.setClassName(AreaFix.class.getCanonicalName());
areafix.setRobot("areafix");
ORMManager.get(Robot.class).save(areafix);
Robot filefix = new Robot();
filefix.setClassName(FileFix.class.getCanonicalName());
filefix.setRobot("filefix");
ORMManager.get(Robot.class).save(filefix);
Robot scriptfix = new Robot();
scriptfix.setClassName(ScriptFix.class.getCanonicalName());
scriptfix.setRobot("scriptfix");
ORMManager.get(Robot.class).save(scriptfix);
logger.l1("[+] Robots created");
// owner's point
String ownAddr = FtnTools.getPrimaryFtnAddress().toString();
if (!ownAddr.contains(".")) {
ownAddr += ".1";
}
Link owner = ORMManager.get(Link.class).getFirstAnd("ftn_address", "=",
ownAddr);
if (owner == null) {
owner = new Link();
owner.setLinkName(info.getSysop());
owner.setLinkAddress(ownAddr);
owner.setProtocolHost("-");
owner.setProtocolPort(0);
owner.setPaketPassword(FtnTools.generate8d());
owner.setProtocolPassword(owner.getPaketPassword());
ORMManager.get(Link.class).save(owner);
logger.l1("[+] owner point account created");
logger.l1(String.format("\n\tFTN: %s\n\tAka: %s\n\tPassword: %s\n",
owner.getLinkAddress(), owner.getLinkName(),
owner.getPaketPassword()));
long nice = 1;
Rewrite rw = new Rewrite();
rw.setType(Type.NETMAIL);
rw.setLast(true);
rw.setNice(nice++);
rw.setOrig_from_addr("^"
+ ownAddr.replace(".", "\\.").replace("/", "\\/") + "$");
rw.setNew_from_addr(FtnTools.getPrimaryFtnAddress().toString());
ORMManager.get(Rewrite.class).save(rw);
for (FtnAddress address : info.getAddressList()) {
Rewrite rw2 = new Rewrite();
rw2.setType(Type.NETMAIL);
rw2.setLast(true);
rw2.setNice(nice++);
rw2.setOrig_to_addr("^"