1
0
New Future 9 жил өмнө
parent
commit
71246a29bb
3 өөрчлөгдсөн 5 нэмэгдсэн , 1 устгасан
  1. 1 1
      dnspod.py
  2. 2 0
      run.bat
  3. 2 0
      run.py

+ 1 - 1
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)

+ 2 - 0
run.bat

@@ -0,0 +1,2 @@
+@ECHO OFF
+python %~dp0run.py >> %~dp0run.log

+ 2 - 0
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)