No more catch-all aliases, and default aliases go to a separate file
[hcoop/domtool2.git] / src / plugins / bind.sml
index 5f37520..20c3c10 100644 (file)
@@ -71,7 +71,8 @@ val record = fn (EApp ((EApp ((EVar "dnsA", _), e1), _), e2), _) =>
 
 fun writeRecord (evs, r) =
     case !dns of
-       NONE => print "Warning: DNS directive ignored because no master DNS server is configured for this domain\n"
+       NONE => print ("Warning: DNS directive for " ^ Domain.currentDomain ()
+                      ^ " ignored because no master DNS server is configured for this domain\n")
       | SOME files =>
        let
            fun write s = #write files s
@@ -163,7 +164,7 @@ val () = Slave.registerFileHandler (fn fs =>
                                           fun dnsChanged () =
                                               if #domain fs = !didDomain then
                                                   ()
-                                              else if #action fs = Slave.Delete then
+                                              else if Slave.isDelete (#action fs) then
                                                   let
                                                       val fname = OS.Path.joinBaseExt {base = #domain fs,
                                                                                        ext = SOME "zone"}
@@ -282,4 +283,12 @@ val () = Slave.registerPostHandler
 val () = Domain.registerResetLocal (fn () =>
                                       ignore (OS.Process.system (Config.rm ^ " -rf /var/domtool/zones/*")))
 
+val () = Domain.registerDescriber (Domain.considerAll
+                                  [Domain.Filename {filename = "named.conf",
+                                                    heading = "named.conf addition:",
+                                                    showEmpty = false},
+                                   Domain.Filename {filename = "dns",
+                                                    heading = "DNS zonefile contents:",
+                                                    showEmpty = false}])
+
 end