!7
static double refreshEvery = 60;
static int smartBotTimeOut = 60*30;
sS zone = [[
botcompany.de. IN SOA ns1.bothouse.de. stefan\.reich\.maker\.of\.eye.gmail.com. (
20190925 ; Serial
30M ; Refresh
1M ; Retry
7D ; Expiry
30M ) ; Minimum
@ IN NS ns1.bothouse.de.
@ IN NS ns2.bothouse.de.
@ IN A 167.86.121.181
gazelle IN A 207.180.245.135
seven IN A 207.180.245.135
fourg IN A 164.68.97.209
new IN A 164.68.97.209
bird IN A 164.68.97.209
contabo2 IN A 164.68.97.209
c8 IN A 167.86.121.181
home 300 IN A 2.203.147.51
oldmain IN A 185.183.156.46
coffee IN A 195.154.179.147
code IN A 167.86.121.181
www IN A 167.86.121.181
butter IN A 167.86.121.181
smartbot IN A 167.86.121.181
create IN A 167.86.121.181
mail IN A 167.86.121.181
javax IN A 167.86.121.181
mech IN A 167.86.121.181
atom IN A 51.15.177.171
;@ MX 10 mail1.domainssaubillig.de.
@ MX 10 mail.botcompany.de.
mail MX 10 mail.botcompany.de.
_acme-challenge.botcompany.de. IN TXT "FcabE7k5a7jQafkMPrsn8NfF7K7sRPc2PZCYMf5fDBw"
]];
sS zone2 = [[
agi.blue. IN SOA ns1.bothouse.de. stefan\.reich\.maker\.of\.eye.gmail.com. (
20190101 ; Serial
30M ; Refresh
1M ; Retry
7D ; Expiry
30M ) ; Minimum
@ IN NS ns1.bothouse.de.
@ IN NS ns2.bothouse.de.
@ IN A 167.86.121.181
* IN A 167.86.121.181
@ MX 10 mail1.domainssaubillig.de.
mail MX 10 mail.botcompany.de.
agi.blue IN TXT "google-site-verification=oRvyeTqgSuv-FE_c-2UKM1Vp0oDqx8h9WruHYWqA-NQ"
_acme-challenge.agi.blue. IN TXT "5-eBkkE89wC9wtMXcS1xC60a2ZXlHvUcCoEX_b-s9bg"
]];
sS zone3 = [[
imager.site. IN SOA ns1.bothouse.de. stefan\.reich\.maker\.of\.eye.gmail.com. (
20190101 ; Serial
30M ; Refresh
1M ; Retry
7D ; Expiry
30M ) ; Minimum
@ IN NS ns1.bothouse.de.
@ IN NS ns2.bothouse.de.
@ IN A 51.15.177.171
whn62nj25rxe IN CNAME gv-47ybpz4mzrlneb.dv.googlehosted.com.
* IN A 51.15.177.171
@ MX 10 mail1.domainssaubillig.de.
mail MX 10 mail.botcompany.de.
imager.site. IN TXT "google-site-verification=TnOZdU3BMzm7mGefSgTd0HKeiPxS7k17dkx8Tiuf3bA"
test. IN TXT "test2"
]];
lib 1008223 // dnsjava
lib 1010766 // EagleDNS
lib 1004911 // log4j
import se.unlogic.eagledns.EagleDNS;
static File zonesDir;
static EagleDNS eagleDNS;
p {
tryToAcquirePort5000();
S conf = loadSnippet(#1010767);
zonesDir = programFile("zones");
saveZones();
conf = conf.replace(
[[zones]],
[[]] + f2s(zonesDir) + [[]]);
File configFile = saveProgramTextFile("config.xml", conf);
//eagleDNS = nuObject("se.unlogic.eagledns.EagleDNS", f2s(configFile));
eagleDNS = new EagleDNS(f2s(configFile));
bot("Eagle DNS.");
doEvery_daemon(refreshEvery, f refresh);
}
answer {
if "test" ret "OK";
if "refresh" {
refresh();
ret "OK";
}
}
static void refresh() {
saveZones();
eagleDNS.reloadZones();
}
sS makeZone {
S z = rtrim(zone);
S ip = smartBotIP();
if (ip != null) {
z += "\nsmartbot-direct \*smartBotTimeOut*/ IN A " + ip;
z += "\nsmartbot \*smartBotTimeOut*/ IN A " + ip;
}
ret z;
}
static void saveZones {
saveTextFile(newFile(zonesDir, "botcompany.de"), makeZone());
saveTextFile(newFile(zonesDir, "agi.blue"), zone2);
saveTextFile(newFile(zonesDir, "imager.site"), zone3);
}