X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/e0b0abd209a1ecbd9266cfcf8735af171f96869b..976657583f419a6a204400ea90f9758d15243acb:/src/plugins/bind.sml diff --git a/src/plugins/bind.sml b/src/plugins/bind.sml index 4b09b45..8dc1a72 100644 --- a/src/plugins/bind.sml +++ b/src/plugins/bind.sml @@ -39,7 +39,8 @@ val _ = Domain.registerBefore (Domain.dnsMaster ())) val _ = Domain.registerAfter - (fn _ => Option.app TextIO.closeOut (!dns)) + (fn _ => (Option.app TextIO.closeOut (!dns); + dns := NONE)) val dl = ErrorMsg.dummyLoc @@ -50,7 +51,7 @@ datatype dns_record = | NS of string val record = fn (EApp ((EApp ((EVar "dnsA", _), e1), _), e2), _) => - (case (Env.string e1, Env.string e2) of + (case (Env.string e1, Domain.ip e2) of (SOME v1, SOME v2) => SOME (A (v1, v2)) | _ => NONE) | (EApp ((EApp ((EVar "dnsCNAME", _), e1), _), e2), _) => @@ -129,7 +130,8 @@ val () = Slave.registerFileHandler (fn fs => val fname = OS.Path.joinDirFile {dir = Config.Bind.zonePath, file = fname} in - OS.FileSys.remove fname + Slave.shellF ([Config.rm, " -f ", fname], + fn cl => "Error deleting file: " ^ cl) end else let @@ -176,8 +178,11 @@ val () = Slave.registerFileHandler (fn fs => TextIO.output (outf, Int.toString min); TextIO.output (outf, " )\n\n"); TextIO.closeOut outf; - Slave.shellF ([Config.cat, " ", dns, " >>", fname], - fn cl => "Error concatenating file: " ^ cl); + if Posix.FileSys.access (dns, []) then + Slave.shellF ([Config.cat, " ", dns, " >>", fname], + fn cl => "Error concatenating file: " ^ cl) + else + (); didDomain := #domain fs end in