!7 static double refreshEvery = 60; static int smartBotTimeOut = 60*30; sS zone = [[ botcompany.de. IN SOA tinybrain.de. stefan\.reich\.maker\.of\.eye.gmail.com. ( 20190101 ; Serial 30M ; Refresh 1M ; Retry 7D ; Expiry 30M ) ; Minimum @ IN NS tinybrain.de. @ IN A 185.183.156.46 onfire IN A 62.113.206.87 ipp IN A 185.242.113.246 gazelle IN A 185.242.113.246 monkey IN A 185.242.113.246 ontology IN A 185.242.113.246 car IN A 185.242.113.246 eagle IN A 94.249.254.127 home 300 IN A 2.203.147.51 qanda IN CNAME qanda-die-zweide.herokuapp.com. qanda2 IN CNAME qanda-die-zweide.herokuapp.com. * IN A 185.183.156.46 @ MX 10 mail1.domainssaubillig.de. ]]; 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, "ai1.space"), null /*zone2*/); }