]> average.org Git - pdns-pipe-nmc.git/commitdiff
test function to interactively ask about a domain
authorEugene Crosser <crosser@average.org>
Sat, 29 Mar 2014 19:34:11 +0000 (23:34 +0400)
committerEugene Crosser <crosser@average.org>
Sat, 29 Mar 2014 19:34:11 +0000 (23:34 +0400)
PowerDns.hs
pdns-pipe-nmc.hs

index 6800143dcd243b8d595f1a78d329509b9fbdb3bc..cb685dd4e96fadfb9e83359568365e46c5d7ddde 100644 (file)
@@ -1,4 +1,4 @@
-module PowerDns ( RRType
+module PowerDns ( RRType(..)
                 , PdnsRequest(..)
                 , pdnsParse
                 , pdnsOut
index 9e4a72930691ab6b58e53e6220c4d6c495c5e4ce..e9b29690aa0a866f2e57749dc41efa14fe304d4f 100644 (file)
@@ -100,3 +100,13 @@ main = do
           PdnsRequestAXFR xfrreq ->
             putStrLn ("ERROR\tNo support for AXFR " ++ xfrreq)
           PdnsRequestPing -> putStrLn "OK"
+
+-- for testing
+
+ask str = do
+  cfg <- readConfig confFile
+  mgr <- newManager def
+  ncres <- queryNmc mgr cfg str "test-req-id"
+  case ncres of
+    Left  e   -> putStrLn $ "ERROR\t" ++ e
+    Right dom -> putStrLn $ pdnsOut RRTypeANY dom