projects
/
dyn-nsupdate.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
97db647
)
query our own IP only once
author
Ralf Jung
<post@ralfj.de>
Sun, 11 May 2014 17:17:36 +0000
(19:17 +0200)
committer
Ralf Jung
<post@ralfj.de>
Sun, 11 May 2014 17:17:36 +0000
(19:17 +0200)
client.py
patch
|
blob
|
history
diff --git
a/client.py
b/client.py
index d32542b1e3e6b8ba579d52fabfbc0fbd4583cac5..e556ab7f4bd5f4582768f118cb7d82839b5e533b 100755
(executable)
--- a/
client.py
+++ b/
client.py
@@
-7,10
+7,12
@@
domains = ['your.domain.ralfj.de'] # list of domains to update
password = 'yourpassword'
# END of configuration variables
password = 'yourpassword'
# END of configuration variables
+myip = urllib2.urlopen('https://'+server+'/checkip').read().strip()
+
def update_domain(domain):
'''Update the given domain, using the global server, user, password. Returns True on success, False on failure.'''
def update_domain(domain):
'''Update the given domain, using the global server, user, password. Returns True on success, False on failure.'''
+ global myip
# check if the domain is already mapped to our current IP
# check if the domain is already mapped to our current IP
- myip = urllib2.urlopen('https://'+server+'/checkip').read().strip()
domainip = socket.gethostbyname(domain)
if myip == domainip:
# nothing to do
domainip = socket.gethostbyname(domain)
if myip == domainip:
# nothing to do