From 9ef6b8b7e3a1eeb20cdde32541e6d2aa549ba3b1 Mon Sep 17 00:00:00 2001 From: Eugene Crosser Date: Sat, 29 Mar 2014 23:34:11 +0400 Subject: [PATCH] test function to interactively ask about a domain --- PowerDns.hs | 2 +- pdns-pipe-nmc.hs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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 -- 2.39.2