Tweak background process output handling
This commit is contained in:
parent
17780ed5f7
commit
831cfbcc58
@ -1376,17 +1376,19 @@ install_base()
|
||||
{
|
||||
if [[ $RSYNC_PID || $MIRROR_PID ]]; then
|
||||
local oldmsg="" msg=""
|
||||
printf "\nOne or more background install processes are still running, grabbing their output...\n"
|
||||
while kill -0 "$RSYNC_PID" 2>/dev/null || kill -0 "$MIRROR_PID" 2>/dev/null; do
|
||||
msg="$(tail -n 1 /tmp/bg_out)"
|
||||
if [[ "$msg" != "$oldmsg" ]]; then
|
||||
printf "\n%s" "$msg"
|
||||
oldmsg="$msg"
|
||||
else
|
||||
printf "."
|
||||
sleep 0.5
|
||||
fi
|
||||
done
|
||||
if kill -0 "$RSYNC_PID" 2>/dev/null || kill -0 "$MIRROR_PID" 2>/dev/null; then
|
||||
printf "\nOne or more background install processes are still running, grabbing their output...\n"
|
||||
while kill -0 "$RSYNC_PID" 2>/dev/null || kill -0 "$MIRROR_PID" 2>/dev/null; do
|
||||
msg="$(tail -n 1 /tmp/bg_out)"
|
||||
if [[ "$msg" != "$oldmsg" ]]; then
|
||||
printf "\n%s" "$msg"
|
||||
oldmsg="$msg"
|
||||
else
|
||||
printf "."
|
||||
sleep 0.5
|
||||
fi
|
||||
done
|
||||
fi
|
||||
trap - EXIT
|
||||
unset RSYNC_PID MIRROR_PID
|
||||
else
|
||||
|
Reference in New Issue
Block a user