diff --git a/dnsupdate.py b/dnsupdate.py index 40f7342..dd9ab80 100644 --- a/dnsupdate.py +++ b/dnsupdate.py @@ -71,6 +71,9 @@ def getparams(msg): parser.add_option("-t", "--ttl", type="int", help="TTL in seconds") + parser.add_option("-v", "--verbose", + action="store_true", + help="Print progress information") (options, args) = parser.parse_args() @@ -78,7 +81,6 @@ def getparams(msg): msg['cfgfile'] = options.config msg = readcfg(msg) - # Populate the basic params base_params = ['delete', @@ -103,6 +105,9 @@ def getparams(msg): if ip: msg['ipaddress'] = ip + if options.verbose and msg.has_key('quiet'): + del msg['quiet'] + return msg @@ -123,7 +128,7 @@ def readcfg(msg): for line in cfgfile.readlines(): line = line.strip() - if line.find("#", 0, 1) == 0: + if line.find("#", 0, 1) == 0 or not line: continue (key, value) = line.split('\t', 1) if not value.strip().lower() == "false":