diff --git a/conf_example.py b/conf_example.py index b55cf80232cefd0d9e753306574eb1444ebf45a0..db04d84d4aa659caef1373b97b71a5b1b1492ade 100644 --- a/conf_example.py +++ b/conf_example.py @@ -5,17 +5,14 @@ MĂĄsold ĂĄt conf.py nĂŠvre ĂŠs ott Ărd be a megfelelĹ vĂĄltozĂłkba a megfelelĹ adatokat! """ -# SCHAccount, amihez megcsinĂĄltad adomain regisztrĂĄciĂłt -MY_SCHACC = "" - -# Prefix, amit regisztrĂĄltĂĄl az admin sch-n +# Prefix, amit regisztrĂĄltĂĄl MY_PREFIX = "" # az i42.hu domain hozzĂĄfĹązĂŠsre kerĂźl -# Token, amit admin sch-n regisztrĂĄltĂĄl +# Token, amit regisztrĂĄltĂĄl MY_TOKEN = "" # Az IP cĂm, amire frissĂteni akarod a domain rekordod. Ha errĹl a gĂŠprĹl akarod hasznĂĄlni, akkor hagyd el. # Ha nem muszĂĄj ne hasznĂĄld! -#MY_IP_V6 = "" # opcionĂĄlis -#MY_IP_V6 = "" # szintĂŠn opcionĂĄlis +MY_IP_V4 = "" # opcionĂĄlis +MY_IP_V6 = "" # szintĂŠn opcionĂĄlis diff --git a/update_i42_domain.py b/update_i42_domain.py index b5653d52a999a769a1d30c10fa695327cc69035b..05f994ee51616c3037ba915b6679cb438ccd89c8 100755 --- a/update_i42_domain.py +++ b/update_i42_domain.py @@ -4,10 +4,27 @@ from conf import * import urllib2 +data_v4 = "token=%s&prefix=%s" % (MY_TOKEN, MY_PREFIX) +data_v6 = data_v4 +server = "http://ecklapos.sch.bme.hu:10053" + +if len(MY_IP_V4) > 0: + data_v4 += "ip_address=%s" % MY_IP_V4 + +if len(MY_IP_V4) > 0: + data_v4 += "ip_address=%s" % MY_IP_V6 + +try: + response = urllib2.urlopen(server, data_v4) + print response.read() +except urllib2.HTTPError, ex: + print ex + +""" +#ipv6-on, ha egyszer megcsinĂĄlom try: - response = urllib2.urlopen("http://localhost:10053", - "schacc=%s&token=%s&prefix=%s" % (MY_SCHACC, MY_TOKEN, MY_PREFIX) - ) + response = urllib2.urlopen(server, data_v6) print response.read() except urllib2.HTTPError, ex: print ex +"""