summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-02-05 07:40:43 +0100
committerChristian Poessinger <christian@poessinger.com>2019-02-10 16:23:11 +0100
commit759ac01e68b23b549ba64506c816331e5d4446fd (patch)
tree4a1108d60989be678ee66982b26c54b6ceac1ec6
parent4f61b6a45634dd0e2b596c5477f8de46bd58302f (diff)
downloadvyos-1x-759ac01e68b23b549ba64506c816331e5d4446fd.tar.gz
vyos-1x-759ac01e68b23b549ba64506c816331e5d4446fd.zip
T1231: Remove cache file of 'service dns dynamic'
When deleting or changing "service dns dynamic" the cache file of ddclient is not removed, leading to abandoned host names which might be already gone. (cherry picked from commit ec604ef88e2845bcd75070f6dff325ccc50873aa)
-rwxr-xr-xsrc/conf_mode/dynamic_dns.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/conf_mode/dynamic_dns.py b/src/conf_mode/dynamic_dns.py
index 6f826c18f..ff3c1f825 100755
--- a/src/conf_mode/dynamic_dns.py
+++ b/src/conf_mode/dynamic_dns.py
@@ -24,6 +24,7 @@ from vyos.config import Config
from vyos import ConfigError
config_file = r'/etc/ddclient.conf'
+cache_file = r'/var/cache/ddclient/ddclient.cache'
config_tmpl = """
### Autogenerated by dynamic_dns.py ###
@@ -151,7 +152,7 @@ def get_config():
'server': '',
'custom' : False
}
-
+
# preload protocol from default service mapping
if service in default_service_protocol.keys():
srv['protocol'] = default_service_protocol[service]
@@ -245,6 +246,9 @@ def generate(dyndns):
return None
def apply(dyndns):
+ if os.path.exists(cache_file):
+ os.unlink(cache_file)
+
if dyndns is None:
os.system('/etc/init.d/ddclient stop')
else: