Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 28 lines (23 sloc) 505 Bytes
#!/usr/bin/env python3
from QQWry import QQWry
import ipdb
def main(args):
if len(args) == 1:
ip = args[0]
if '.' in ip:
Q = QQWry()
print(''.join(Q[ip][2:]))
else:
D = ipdb.IPDB(ipdb.DEFAULT_FILE_LOCATION)
print(' '.join(D.lookup(ip).info))
return
Q = QQWry()
D = ipdb.IPDB(ipdb.DEFAULT_FILE_LOCATION)
for ip in args:
if '.' in ip:
print(Q[ip])
else:
print(D.lookup(ip))
if __name__ == '__main__':
import sys
main(sys.argv[1:])