diff options
Diffstat (limited to 'lib/remote/report.sh')
-rw-r--r-- | lib/remote/report.sh | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/remote/report.sh b/lib/remote/report.sh index 434c6aa..c4373a3 100644 --- a/lib/remote/report.sh +++ b/lib/remote/report.sh @@ -3,13 +3,22 @@ function simple_report { local filter="${2:-cat}" # Create fd12 (sending empty output), execute checks (writting extra info on fd12), print main info and store extra info into variable, wait for termination of async checks. - { - chmod +w /dev/fd/12 - eval "$generator 12>/dev/fd/12 | $filter" - report=$(cat<&12) - } 12<<EOF -EOF - wait +# { +# chmod +w /dev/fd/12 +# eval "$generator 12>/dev/fd/12 | $filter" +# report=$(cat<&12) +# } 12<<EOF +#EOF +# wait + + fifo=$(mktemp -u) ; mkfifo "$fifo" + eval "$generator 12>$fifo | $filter" & + genpid=$! + + report_text=$(cat "$fifo") + wait "$genpid" + rm -f "$fifo" + } @@ -30,7 +39,7 @@ function standart_report { configure_palete "$palete" simple_report "$generator" "$filter" - print "$report" + print "$report_text" echo finish } @@ -38,7 +47,7 @@ function standart_report { function report { # Eval breaks output for some reason - case $report in + case $report_style in simple_report) simple_report "$@" ;; |