summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-06-10 07:45:36 +0200
committerGitHub <noreply@github.com>2023-06-10 07:45:36 +0200
commit0b99a4cba1279b5a27d2fa013004501f89b3edce (patch)
treed2db029afbd2b3cbaa656414f66d41da5f2bbd6a /src
parenta7ee793b4e1f038e9b0f0774f10c407fc36ec164 (diff)
parent2e79de15fc3852a67d2fa4ae557ecd091a3ad780 (diff)
downloadvyos-1x-0b99a4cba1279b5a27d2fa013004501f89b3edce.tar.gz
vyos-1x-0b99a4cba1279b5a27d2fa013004501f89b3edce.zip
Merge pull request #2035 from indrajitr/ddclient-improvement-round-4
dns: T5144: Improve dynamic dns monitor and log and miscellaneous updates
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/dns_dynamic.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/conf_mode/dns_dynamic.py b/src/conf_mode/dns_dynamic.py
index e070a3502..67134e681 100755
--- a/src/conf_mode/dns_dynamic.py
+++ b/src/conf_mode/dns_dynamic.py
@@ -117,13 +117,17 @@ def generate(dyndns):
return None
def apply(dyndns):
+ systemd_service = 'ddclient.service'
+ # Reload systemd manager configuration
+ call('systemctl daemon-reload')
+
# bail out early - looks like removal from running config
if not dyndns or 'address' not in dyndns:
- call('systemctl stop ddclient.service')
+ call(f'systemctl stop {systemd_service}')
if os.path.exists(config_file):
os.unlink(config_file)
else:
- call('systemctl restart ddclient.service')
+ call(f'systemctl reload-or-restart {systemd_service}')
return None