summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-09-03 23:16:59 +0200
committerChristian Poessinger <christian@poessinger.com>2020-09-03 23:16:59 +0200
commit755c796f4350ed64add42acd199de631aea98129 (patch)
tree06bcd8410d1626145e14300e7ffce79b16721bd2 /src/conf_mode
parent33684c1a645e5b9124a8a8630e8f3c168420d23e (diff)
downloadvyos-1x-755c796f4350ed64add42acd199de631aea98129.tar.gz
vyos-1x-755c796f4350ed64add42acd199de631aea98129.zip
ddclient: T2852: cleanup files after service deletion
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/dynamic_dns.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/conf_mode/dynamic_dns.py b/src/conf_mode/dynamic_dns.py
index 5cf526434..2c1cb5dc3 100755
--- a/src/conf_mode/dynamic_dns.py
+++ b/src/conf_mode/dynamic_dns.py
@@ -260,15 +260,15 @@ def generate(dyndns):
def apply(dyndns):
if dyndns is None:
os.system('/etc/init.d/ddclient stop')
+ if os.path.exists(pid_file):
+ os.unlink(pid_file)
if os.path.exists(config_file):
os.unlink(config_file)
+ if os.path.exists(cache_file):
+ os.unlink(cache_file)
else:
- if os.path.exists(dyndns['pid_file']):
- os.unlink(dyndns['pid_file'])
- if os.path.exists(dyndns['cache_file']):
- os.unlink(dyndns['cache_file'])
-
os.system('/etc/init.d/ddclient restart')
+
return None
if __name__ == '__main__':