Browse files

also report running count of entries found; report partial results on ^C

  • Loading branch information...
1 parent 690c71d commit a7cc5523ee55c45bc343dd1611e9e0341ea0453d @Habbie committed Mar 29, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 ip6-arpa-scan.py
View
7 ip6-arpa-scan.py
@@ -14,7 +14,7 @@ def tryquery(q, server):
def drilldown(base, server, limit):
global queries, l
- print >> sys.stderr, '\r%*s, %s queries done' % (limit, base, queries),
+ print >> sys.stderr, '\r%*s, %s queries done, %s found' % (limit, base, queries, len(l)),
q = message.make_query(base, 'PTR')
r = tryquery(q, server)
@@ -43,7 +43,10 @@ def drilldown(base, server, limit):
print 'please pass an ip6.arpa name'
sys.exit(1)
-drilldown(base, server, limit)
+try:
+ drilldown(base, server, limit)
+except KeyboardInterrupt:
+ print >> sys.stderr, '\naborted, partial results follow'
print >> sys.stderr, '\nnames found: %s' % len(l)
print >> sys.stderr, 'queries done: %s' % queries

0 comments on commit a7cc552

Please sign in to comment.