diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-12-06 21:07:46 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-12-06 21:07:46 +0100 |
commit | bebd084651b50171e696af232a9c403f69ac6230 (patch) | |
tree | 6fc3a74465c94f1536d77fd3fc0f0dcc9cf47148 /src/conf_mode/dynamic_dns.py | |
parent | a96ffc33cc63918ba3815f66c506c717a8676621 (diff) | |
parent | 1ac177febfdd0dfc5a5b40a1b30294de0e2a45e0 (diff) | |
download | vyos-1x-bebd084651b50171e696af232a9c403f69ac6230.tar.gz vyos-1x-bebd084651b50171e696af232a9c403f69ac6230.zip |
Merge branch 'current' of github.com:vyos/vyos-1x into equuleus
* 'current' of github.com:vyos/vyos-1x:
openvpn: bridge: T1556: remove obsolete bridge-group definition
ifconfig: T1849: fix DHCPv6 startup
Python/VyOS validate: T1849: handle is_ipv6()/is_ipv6() exceptions
ifconfig: T1793: remove dhcpv6 client debug output
ddclient: T1853: bugfix TypeError exception
syslog: T1845: syslog host no longer accepts a port
syslog: code formatting
syslog: T1845: syslog host no longer accepts a port
syslog: renaming files and conf script to fit new scheme
T1855, T1826: clean up the reboot/shutdown script.
wireguard: T1853: disable peer doesn't work
Revert "syslog: T1845: syslog host no longer accepts a port"
dmvpn: T1784: Add swanctl load call
syslog: T1845: syslog host no longer accepts a port
[vyos.config] T1847: correctly set_level for path given as empty string
Diffstat (limited to 'src/conf_mode/dynamic_dns.py')
-rwxr-xr-x | src/conf_mode/dynamic_dns.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/conf_mode/dynamic_dns.py b/src/conf_mode/dynamic_dns.py index 7c3b9ff6a..9ba8659a1 100755 --- a/src/conf_mode/dynamic_dns.py +++ b/src/conf_mode/dynamic_dns.py @@ -95,6 +95,7 @@ default_service_protocol = { default_config_data = { 'interfaces': [], 'cache_file': cache_file, + 'deleted': False, 'pid_file': pid_file } @@ -102,7 +103,8 @@ def get_config(): dyndns = default_config_data conf = Config() if not conf.exists('service dns dynamic'): - return None + dyndns['deleted'] = True + return dyndns else: conf.set_level('service dns dynamic') @@ -194,7 +196,7 @@ def get_config(): def verify(dyndns): # bail out early - looks like removal from running config - if dyndns is None: + if dyndns['deleted']: return None # A 'node' corresponds to an interface @@ -239,7 +241,10 @@ def verify(dyndns): def generate(dyndns): # bail out early - looks like removal from running config - if dyndns is None: + if dyndns['deleted']: + if os.path.exists(config_file): + os.unlink(config_file) + return None dirname = os.path.dirname(dyndns['pid_file']) @@ -264,7 +269,7 @@ def apply(dyndns): if os.path.exists('/etc/ddclient.conf'): os.unlink('/etc/ddclient.conf') - if dyndns is None: + if dyndns['deleted']: os.system('/etc/init.d/ddclient stop') if os.path.exists(dyndns['pid_file']): os.unlink(dyndns['pid_file']) |