summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/backup.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2021-02-11 14:06:45 +0100
committermakefu <github@syntax-fehler.de>2021-02-11 14:06:45 +0100
commit540e13721d85dcf100bf3529414d96cd8e28a446 (patch)
tree7db6b3955f8f06af83434027e4825f8b160ba9d4 /krebs/3modules/backup.nix
parent38bddfd404b4418b4e820dfbd312145fc6abca68 (diff)
parentd0e7bc46b4cdb15f7505aa069ac29588b02ddf92 (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'krebs/3modules/backup.nix')
-rw-r--r--krebs/3modules/backup.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/krebs/3modules/backup.nix b/krebs/3modules/backup.nix
index c0b218c1..910324f3 100644
--- a/krebs/3modules/backup.nix
+++ b/krebs/3modules/backup.nix
@@ -226,10 +226,14 @@ let
# XXX Is one ping enough to determine fastest address?
fastest-address = host: ''
- { ${pkgs.fping}/bin/fping </dev/null -a \
+ { ${pkgs.fping}/bin/fping </dev/null -a -e \
${concatMapStringsSep " " shell.escape
(mapAttrsToList (_: net: head net.aliases) host.nets)} \
- | ${pkgs.coreutils}/bin/head -1; }
+ | ${pkgs.gnused}/bin/sed -r 's/^(\S+) \(([0-9.]+) ms\)$/\2\t\1/' \
+ | ${pkgs.coreutils}/bin/sort -n \
+ | ${pkgs.coreutils}/bin/cut -f2 \
+ | ${pkgs.coreutils}/bin/head -n 1
+ }
'';
in out