0

I want to use the Fritzbox update feature of DDClient, but also want to have a fallback to a public web server, if that does not work for some reason (e.g. cause someone just switched to another router or whatever…).

As far as I known, just duplicating the use=cmd key seems to override the previous configuration?

protocol=dyndns2
use=cmd, cmd='curl https://checkipv4.dedyn.io/'
use=cmd, cmd=/etc/ddclient/get-ip-from-fritzbox
#use=if, if=eth0
ssl=yes

server=update.dedyn.io
login=domain.dedyn.io
password='___password_here____'
domain.dedyn.io

The syntax use=cmd, cmd='curl https://checkipv4.dedyn.io/', cmd=/etc/ddclient/get-ip-from-fritzbox also works, but I guess it does the same, or does not it?

In any case the official documentation is of little help and does not explain the configuration format in a very elaborate way.

So can you actually specify a fallback in ddclient? If so, how?

rugk
  • 2,806
  • 6
  • 28
  • 58

1 Answers1

1

Since both of these are external commands, you could create a script file with suitable logic, say something like:

#! /bin/sh
curl -fs https://checkipv4.dedyn.io/ ||
    /etc/ddclient/get-ip-from-fritzbox
# Or the other way around, depending on what you need

And use that as the cmd.

muru
  • 69,900
  • 13
  • 192
  • 292