; ---


if exists uuspool:newsbatch
   echo "Unbatching...."
   copy usr:spool/newsbatch t:
   delete uuspool:newsbatch quiet
   failat 30         ;don't worry if we can't find GetPriority
   getpriority >nil:    ;preserve the current priority in a local variable
   failat 20         ;back to default
   changetaskpri -4     ;postprocessing is a background task
   dannews t:newsbatch STATS DELETE BLIP 1 ;postprocess news to uucp news base
   failat 10            ; because
   get >nil: Priority      ;check that Priority local var. was set
   if not WARN
      changetaskpri $Priority ;re-instate the saved priority
   endif
   echo "Complete."
else
   echo "Sorry, no news unbatched"
endif

setenv USERNAME $USER        ; to make sure its set
ActiveD                      ; create a new active file
Delete UULIB:Active quiet    ; Delete old active file
Rename UULIB:newsactive UULIB:Active  ; insert new active file

tin.exe             ; start tin itself

trimnews

UnSetENV TIN_GROUPS           ; this is set by ActiveD for TIN
