#make log tty and initalize index file writing if needed. 

source logttypars

if [ "$only_params" != y ]; then


if [ $makeindexfile = y ]; then
 mkfifo /tmp/tbup/logtty
 holdfifo /tmp/tbup/logtty &
 export holdfifopid=$!
 if [ -e descr ]; then
   cat descr >$indexfilename
 else
   echo -n >$indexfilename
 fi
 echo "----parameters:-----" >>$indexfilename
 cat allpars >>$indexfilename
 echo "-------------$ttytitle index---------------------" >>$indexfilename
else
 ln -s /tmp/tbup/logttydev /tmp/tbup/logtty
fi



cat >/tmp/tbup/logttydev <<-END

------------------$ttytitle progress--------------------

END

if [ $makeindexfile = y ]; then

printf "\007" >pausewarn
cat >>pausewarn <<-blex
             *** Now pausing the $ttytitle ***
 Free disk space for $indexfilename has dropped below 50Kb.
 Please free some disk space (e.g. by compressing some files) to continue
 with the $ttytitle.
blex
printf "\007" >>pausewarn

 mytee 2>/tmp/tbup/logttydev </tmp/tbup/logtty | \
 flowpause -k50 "-w/tmp/tbup/pausewarn" $indexfilename >>$indexfilename &
fi


fi
 #(if only_params)
