servo: dyn-dns: have getIp command use a fallback

This commit is contained in:
Colin 2023-02-21 11:24:43 +00:00
parent 58b219546b
commit 017aa335b1

View File

@ -3,6 +3,11 @@
with lib;
let
cfg = config.sane.services.dyn-dns;
getIp = pkgs.writeShellScript "dyn-dns-query-wan" ''
# preferred method and fallback
${pkgs.sane-scripts}/bin/sane-ip-check-router-wan || \
${pkgs.sane-scripts}/bin/sane-ip-check
'';
in
{
options = {
@ -19,7 +24,7 @@ in
};
ipCmd = mkOption {
default = "${pkgs.sane-scripts}/bin/sane-ip-check-router-wan";
default = "${getIp}";
type = types.path;
description = "command to run to query the current WAN IP";
};