Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Danamir committed May 22, 2019
2 parents ab1569c + b90167f commit cc66623
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dyn_gandi.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import json
import os
import sys
import re
from configparser import ConfigParser
from datetime import datetime

Expand Down Expand Up @@ -180,7 +181,13 @@ def main():
print("Wrote %s to %s file." % (ip, out_file))

# Query LiveDNS API
domain = config['dns']['domain']
domain = config['dns']['domain'] # type: str

if re.match(r"^.+\.[^.]+\.[^.]+$", domain):
if verbose:
print("Warning: removing sub-domain part of %s" % domain)
domain = re.sub(r"^.+\.([^.]+\.[^.]+)$", r"\g<1>", domain)

if verbose:
print("Domain: %s" % domain)

Expand Down

0 comments on commit cc66623

Please sign in to comment.