+if __name__ == "__main__":
+ # allow overwriting some values on the command-line
+ parser = argparse.ArgumentParser(description='Update a domain managed by a dyn-nsupdate server')
+ parser.add_argument("-p", "--password",
+ dest="password", default=password,
+ help="The password used to update the domains")
+ parser.add_argument("-v", "--verbose",
+ action="store_true", dest="verbose",
+ help="Be more verbose")
+ parser.add_argument("domains", metavar='DOMAIN', nargs='*', default=domains,
+ help="The domains to update")
+ args = parser.parse_args()
+
+ # get our own IPs
+ myIPv4 = getMyIP(serverIPv4) if haveIPv4 else None
+ myIPv6 = getMyIP(serverIPv6) if haveIPv6 else None
+
+ # update all the domains
+ exitcode = 0
+ for domain in args.domains:
+ if not update_domain(server, domain, myIPv4, myIPv6, args.password, verbose=args.verbose):
+ exitcode = 1
+ sys.exit(exitcode)