As seen in the wild with DynDNS.com -- status '14' is being stored
for the first host which is removed from @hosts ending up reading
empty host for next line causing 'nochg' to be misplaced in an empty
host. The same likely applies for multi-host handling so expand to
loop where writing to config and use $hosts when logging to catch all.
RECEIVE: HTTP/1.1 200 OK
RECEIVE: Date: Thu, 01 Jun 2023 06:59:38 GMT
RECEIVE: Server: Apache/2.4.18 (Ubuntu)
RECEIVE: Strict-Transport-Security: max-age=31536000
RECEIVE: X-UpdateCode: n
RECEIVE: Vary: Accept-Encoding
RECEIVE: Content-Type: text/plain
RECEIVE: Accept-Ranges: none
RECEIVE: X-User-Status: vip
RECEIVE: Connection: close
RECEIVE: Transfer-Encoding: chunked
RECEIVE:
RECEIVE: 14
RECEIVE: nochg 192.168.178.20
RECEIVE: 0
RECEIVE:
Looks like there is a bug in line 542 in ddclient.in. The syntax of how the server URL is being set is different to all the other dynamic DNS services. To be precise there is one additional parameter. Instead of handing over the URL, the server variable receives the second "1" in the code below.
This improves the chances that the local DNS resolver (e.g. dnsmasq,
systemd-resolved, Unbound) is up before the service runs and avoids
DNS related failures.
Pull in network-online.target via Wants= to comply with its description
in the systemd.special(7) man page and remove the redundant
"After=network.target" since network-online.target already orders itself
after network.target.
$globals{postscript} can now contain a full command string including
arguments. In order to facilitate this, the file executability check
(-x) has been modified such that the first substring up to the first
space (if it exists) is what is checked, rather than the whole string.
Example bodies I've seen:
```
0013
good 127.0.0.1
0
```
```
0013
nochg 127.0.0.1
0
```
```
007
nohost
0
```
Seems like the trailing zero was not there before as the code relied
on `pop`. Instead, we find the first line that matches `good`/`nochg`.