krebs.backup fping: select fastest by elapsed time
This commit is contained in:
parent
e2ed72a780
commit
1cd73df0c8
|
@ -226,10 +226,14 @@ let
|
||||||
|
|
||||||
# XXX Is one ping enough to determine fastest address?
|
# XXX Is one ping enough to determine fastest address?
|
||||||
fastest-address = host: ''
|
fastest-address = host: ''
|
||||||
{ ${pkgs.fping}/bin/fping </dev/null -a \
|
{ ${pkgs.fping}/bin/fping </dev/null -a -e \
|
||||||
${concatMapStringsSep " " shell.escape
|
${concatMapStringsSep " " shell.escape
|
||||||
(mapAttrsToList (_: net: head net.aliases) host.nets)} \
|
(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
|
in out
|
||||||
|
|
Loading…
Reference in New Issue
Block a user