From: Eugene Crosser Date: Sat, 29 Mar 2014 19:34:11 +0000 (+0400) Subject: test function to interactively ask about a domain X-Git-Tag: 0.9.0.0~112 X-Git-Url: http://average.org/gitweb/?a=commitdiff_plain;h=9ef6b8b7e3a1eeb20cdde32541e6d2aa549ba3b1;p=pdns-pipe-nmc.git test function to interactively ask about a domain --- diff --git a/PowerDns.hs b/PowerDns.hs index 6800143..cb685dd 100644 --- a/PowerDns.hs +++ b/PowerDns.hs @@ -1,4 +1,4 @@ -module PowerDns ( RRType +module PowerDns ( RRType(..) , PdnsRequest(..) , pdnsParse , pdnsOut diff --git a/pdns-pipe-nmc.hs b/pdns-pipe-nmc.hs index 9e4a729..e9b2969 100644 --- a/pdns-pipe-nmc.hs +++ b/pdns-pipe-nmc.hs @@ -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