servo: dyn-dns: have getIp
command use a fallback
This commit is contained in:
parent
58b219546b
commit
017aa335b1
|
@ -3,6 +3,11 @@
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
cfg = config.sane.services.dyn-dns;
|
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
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
|
@ -19,7 +24,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
ipCmd = mkOption {
|
ipCmd = mkOption {
|
||||||
default = "${pkgs.sane-scripts}/bin/sane-ip-check-router-wan";
|
default = "${getIp}";
|
||||||
type = types.path;
|
type = types.path;
|
||||||
description = "command to run to query the current WAN IP";
|
description = "command to run to query the current WAN IP";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user