Tweak background process output handling

This commit is contained in:
natemaia 2019-08-25 11:58:59 -07:00
parent 17780ed5f7
commit 831cfbcc58

View File

@ -1376,6 +1376,7 @@ install_base()
{ {
if [[ $RSYNC_PID || $MIRROR_PID ]]; then if [[ $RSYNC_PID || $MIRROR_PID ]]; then
local oldmsg="" msg="" local oldmsg="" msg=""
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" 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 while kill -0 "$RSYNC_PID" 2>/dev/null || kill -0 "$MIRROR_PID" 2>/dev/null; do
msg="$(tail -n 1 /tmp/bg_out)" msg="$(tail -n 1 /tmp/bg_out)"
@ -1387,6 +1388,7 @@ install_base()
sleep 0.5 sleep 0.5
fi fi
done done
fi
trap - EXIT trap - EXIT
unset RSYNC_PID MIRROR_PID unset RSYNC_PID MIRROR_PID
else else