diff options
author | lassulus <lassulus@lassul.us> | 2021-02-03 23:18:38 +0100 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2021-02-03 23:18:38 +0100 |
commit | 0a53ef2a0d06bf347a24eb86132068289568e79c (patch) | |
tree | 923f3736a760190dcb79fea18be670062a822bad /krebs/3modules/backup.nix | |
parent | 5d4e3a953e2c1f8a6c606640f7e8a94e4f64133d (diff) | |
parent | 61aebc5adcab3a174a6e27686c0c8fc7f65df513 (diff) |
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'krebs/3modules/backup.nix')
-rw-r--r-- | krebs/3modules/backup.nix | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/krebs/3modules/backup.nix b/krebs/3modules/backup.nix index c0b218c15..910324f3c 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 |