# Waits for incomming calls, and sets env:Dialer "ON" so DCron stuff won't
# interfere with serial stuff during a mail/newsfeed.  This one is a bit of a
# kludge and not perfect, but it does work.

LogCntr=$(wc -ql spool:logfile) ; setenv LogCnt "$LogCntr"
getenv Getty
if [ "$Getty"="ON" ] then
   while [ "$Getty"="ON" ]
   do sleep 10 ; CheckIt=$(wc -ql spool:logfile) ; getenv LogCnt
      if [ $CheckIt -eq $LogCnt ] then getenv Getty ; continue
      else getenv Dialer
      fi
      if [ "$Dialer"="OFF" ] then setenv Dialer "ON"
      fi
      EndLines=$(tail -2 uuspool:logfile)
      for avar in $EndLines
      do if [ "$avar"="TOTAL" ] then setenv Dialer "OFF"
         CheckIt=$(wc -ql spool:logfile) ; setenv LogCnt "$CheckIt"
         fi
      done
      getenv Getty
   done
fi

