From 017aa335b1d743bd213b6c08373d287897059d08 Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 21 Feb 2023 11:24:43 +0000 Subject: [PATCH] servo: dyn-dns: have `getIp` command use a fallback --- modules/services/dyn-dns.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/services/dyn-dns.nix b/modules/services/dyn-dns.nix index 814b8113..6e801c9e 100644 --- a/modules/services/dyn-dns.nix +++ b/modules/services/dyn-dns.nix @@ -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"; };