From da0fc0844a007fcda04053a65ce660d46901d25a Mon Sep 17 00:00:00 2001 From: New Future Date: Sat, 11 Jun 2016 00:16:14 +0800 Subject: [PATCH] =?UTF-8?q?ipv4=20=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) mode change 100644 => 100755 run.py diff --git a/run.py b/run.py old mode 100644 new mode 100755 index fd33f70..5eeaa56 --- a/run.py +++ b/run.py @@ -29,11 +29,13 @@ def update(): for domain in get_config('ipv4'): print dnspod.change_record(domain, ipv4, 'A') - ipv6 = ip.local_v6(get_config('index6')) - print 'update ipv6 to:', ipv6 - if ipv6 != None: - for domain in get_config('ipv6'): - print dnspod.change_record(domain, ipv6, 'AAAA') + v6_domains=get_config("ipv6") + if len(v6_domains) > 0: + ipv6 = ip.local_v6(get_config('index6')) + print 'update ipv6 to:', ipv6 + if ipv6 != None: + for domain in v6_domains: + print dnspod.change_record(domain, ipv6, 'AAAA') if __name__ == '__main__': dnspod.TOKEN = "%s,%s" % (get_config('id'), get_config('token'))