diff --git a/dnspod.py b/dnspod.py index 8e39c92..b15bfd8 100644 --- a/dnspod.py +++ b/dnspod.py @@ -115,7 +115,7 @@ def update_record(domain, value, record_type="A"): # 更改记录 else: result[id]="update fail!\n"+str(r) else: - result[id]=value + result[id]=domain else: # create #http://www.dnspod.cn/docs/records.html#record-create r = request("Record.Create", domain_id=domainid, value=value, sub_domain=sub, record_type=record_type, record_line="默认", ttl=600) diff --git a/run.bat b/run.bat new file mode 100644 index 0000000..ca75d0e --- /dev/null +++ b/run.bat @@ -0,0 +1,2 @@ +@ECHO OFF +python %~dp0run.py >> %~dp0run.log \ No newline at end of file diff --git a/run.py b/run.py index f844ff0..0656a90 100755 --- a/run.py +++ b/run.py @@ -5,6 +5,7 @@ import dnspod import ip import json import argparse +import time def get_config(key=None, file="config.json"): if not hasattr(get_config, "config"): @@ -20,6 +21,7 @@ def get_config(key=None, file="config.json"): def update(): + print time.ctime() index4=get_config('index4') or 0 if str(index4).isdigit(): ipv4 = ip.local_v4(index4)