-# check if the domain is already mapped to our current IP
-myip = urllib2.urlopen('https://'+server+'/checkip').read().strip()
-currip = socket.gethostbyname(domain)
-if myip == currip:
- # nothing to do
- sys.exit(0)
+def update_domain(domain):
+ '''Update the given domain, using the global server, user, password. Returns True on success, False on failure.'''
+ # 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
+ return True