projects
/
dyn-nsupdate.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dyn-ns-client: add option to remove potentially existing A/AAAA records
[dyn-nsupdate.git]
/
client-scripts
/
dyn-ns-client
diff --git
a/client-scripts/dyn-ns-client
b/client-scripts/dyn-ns-client
index 175d88024259ac9702b27a473f05900de0ca0ed3..f482c194f6fe17ed5a621f04f956f79785b41364 100755
(executable)
--- a/
client-scripts/dyn-ns-client
+++ b/
client-scripts/dyn-ns-client
@@
-61,9
+61,15
@@
def getMyIP(family, config, methods = {}, verbose = 0):
method = config[family]['method']
if method == 'none':
return None
method = config[family]['method']
if method == 'none':
return None
+ elif method == 'remove':
+ return ""
elif method == 'web':
server = config[family].get('server', config['DEFAULT']['server'])
elif method == 'web':
server = config[family].get('server', config['DEFAULT']['server'])
- ip = urlopen('https://'+server+'/checkip', config)
+ url = 'https://'+server+'/checkip'
+ try:
+ ip = urlopen(url, config)
+ except urllib.error.URLError:
+ raise Exception("Error fetching {}, make sure the URL is correct and the internet connection actually works.".format(url))
if verbose >= VERBOSE_FULL:
print("Server",server,"says my",family,"is",ip)
return ip
if verbose >= VERBOSE_FULL:
print("Server",server,"says my",family,"is",ip)
return ip