Now deleting can be restricted to ipv4 or ipv6 if an IP address is given.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 8 Apr 2014 17:50:57 +0000 (19:50 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 8 Apr 2014 18:33:31 +0000 (20:33 +0200)
bin/nsupdate_dyndns

index 604da6b..49ed3e3 100755 (executable)
@@ -29,8 +29,11 @@ def nsupdate_delete(hostname, domain, ip_family):
 
 def main(args):
        if args.delete:
-               nsupdate_delete(args.hostname, args.domain, 'A')
-               nsupdate_delete(args.hostname, args.domain, 'AAAA')
+               if args.ip is None:
+                       nsupdate_delete(args.hostname, args.domain, 'A')
+                       nsupdate_delete(args.hostname, args.domain, 'AAAA')
+               else:
+                       nsupdate_delete(args.hostname, args.domain, ipfamily_by_ip(args.ip))
        else:
                nsupdate_delete(args.hostname, args.domain, ipfamily_by_ip(args.ip))
                nsupdate_add(args.hostname, args.domain, args.ttl, args.ip)