dns/ddclient: Fix Netcup host/domain recognition (#4516)

* Fix ddclient netcup host/domain recognition

* Update dns/ddclient/src/opnsense/scripts/ddclient/lib/account/netcup.py

Co-authored-by: Ad Schellevis <AdSchellevis@users.noreply.github.com>

---------

Co-authored-by: Ad Schellevis <AdSchellevis@users.noreply.github.com>
This commit is contained in:
SaarLAN-Pissbeutel
2025-02-02 13:33:51 +01:00
committed by GitHub
co-authored by Ad Schellevis
parent 49467c3d5d
commit 32f3408f19
@@ -64,7 +64,8 @@ class Netcup(BaseAccount):
syslog.syslog(syslog.LOG_ERR, "Incomplete FQDN offerred %s" % self.settings['hostnames'])
return False
self.hostname, self.domain = self.settings['hostnames'].split('.', 1)
self.domain = self.settings['hostnames'].split('.', self.settings['hostnames'].count('.')-1)[-1]
self.hostname = self.settings['hostnames'].rsplit('.', 2)[0] if self.domain != self.settings['hostnames'] else '@'
if self.settings['password'].count('|') == 1:
self.settings['APIPassword'], self.settings['APIKey'] = self.settings['password'].split('|')