home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 1 / GoldFishApril1994_CD2.img / d4xx / d473 / cnewssrc / cnews_src.lzh / relay / sh / ctlrun < prev    next >
Text File  |  1990-01-22  |  597b  |  24 lines

  1. #! /bin/sh
  2. # ctlrun - run the control messages in control again
  3. # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
  4. . ${NEWSCONFIG-/usr/lib/news/bin/config}
  5. # export NEWSCTL NEWSBIN NEWSARTS
  6. PATH=$NEWSCTL/bin:$NEWSBIN/ctl:$NEWSBIN:$NEWSPATH ; export PATH
  7. umask $NEWSUMASK
  8.  
  9. cd $NEWSCTL
  10. newslock sys LOCK || exit 1
  11.  
  12. cd $NEWSARTS/control
  13.  
  14. for file in *
  15. do
  16.     # cancel, ihave and sendme are internal to relaynews and use < > metachars.
  17.     canonhdr $file | 
  18.         sed -n 's;^Control:[     ]*;'$NEWSBIN/ctl/';p' |
  19.         egrep -v '/(cancel|ihave|sendme) ' >/tmp/ctl$$
  20.     sh -x /tmp/ctl$$ <$file
  21. done
  22.  
  23. rm -f /tmp/ctl$$ $NEWSCTL/LOCK
  24.