home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / news / cnews.tar / conf / histsetup < prev    next >
Text File  |  1995-04-27  |  536b  |  33 lines

  1. #! /bin/sh
  2.  
  3.  
  4.  
  5. # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
  6. . ${NEWSCONFIG-/etc/news/bin/config}
  7.  
  8.  
  9.  
  10. PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
  11. umask $NEWSUMASK
  12.  
  13. cd $NEWSCTL
  14.  
  15. touch history || exit 1
  16. if test -s history
  17. then
  18.     if dbz -v history
  19.     then
  20.         exit 0
  21.     fi
  22.     echo '*** history file exists but index is not dbz format' >&2
  23.     exit 1
  24. fi
  25.  
  26. lock -o LOCK $$ || { echo '*** cannot get the lock file' >&2 ; exit 1 ; }
  27. status=1
  28. trap 'unlock LOCK ; trap 0 ; exit $status' 0 1 2 15
  29.  
  30. dbz history || exit
  31.  
  32. status=0            # and the trap does the exit
  33.