I was hoping there was a better way. I tested using "ip route", however I saw the output below when using mobile as primary and wired as failover. When triggering the failover.
# ip route
default via 192.168.1.254 dev eth1
default via 192.168.1.254 dev eth1 proto static src 192.168.1.252 metric 10
So that means wired is the active connection, but also the backup? It seems to me that parsing the "ip route" output is rather error prone.
And I would also need to get the config for the failover. because in my tests I saw no difference when a connection is not used as failover or the connection is used but not connected. Eg. wired is used as failover, but no cable is connected vs wired is not used as failover. Both scenarios have no line for eth1 in the "ip route" output.
So if there is a better option?