Browse Source

Fixed issue with direct IP looking without an MX address throwing up errors

master
Michael Heidelberger 7 years ago
parent
commit
89fde516ca
  1. 5
      ip-api.py

5
ip-api.py

@ -51,8 +51,7 @@ if __name__ == "__main__":
parser.add_argument("host", help="hostname to lookip") parser.add_argument("host", help="hostname to lookip")
args = parser.parse_args() args = parser.parse_args()
# If the arg is an IP address go straight to API # If the arg is an IP address go straight to API
if re.fullmatch(args.host,
'[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'):
query_api(args.host)
if re.search('[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}', args.host):
query_api([args.host])
else: else:
findMX(args.host) findMX(args.host)
Loading…
Cancel
Save