#!/bin/bash
. ~/.lastfaq
curdir=`pwd`
cd ~/rulinuxfaq/
sgml2txt -f -c latin rulinux.faq.sgml > /dev/null 2>&1
csplit rulinux.faq.txt '/Red Hat  /' '/  /' '/ /' -q
if [ "$FAQPART" = "1" ] ; then 
 if [ -e relnotes.txt ] ; then
  cat relnotes.txt header.txt xx00 > /tmp/faq
 else
  cat header.txt xx00 > /tmp/faq
 fi
 inews -t "FAQ -    " -n fido7.RU.LINUX -S /tmp/faq
 echo "FAQPART=2" > ~/.lastfaq
else 
 if [ "$FAQPART" = "2" ] ; then 
  cat header.txt xx01 > /tmp/faq
  inews -t "FAQ -    " -n fido7.RU.LINUX -S /tmp/faq
  echo "FAQPART=3" > ~/.lastfaq
 else 
  if [ "$FAQPART" = "3" ] ; then 
   cat header.txt xx02 > /tmp/faq
   inews -t "FAQ -    " -n fido7.RU.LINUX -S /tmp/faq
   echo "FAQPART=4" > ~/.lastfaq
  else 
   if [ "$FAQPART" = "4" ] ; then 
    cat header.txt xx03 > /tmp/faq
    inews -t "FAQ -    " -n fido7.RU.LINUX -S /tmp/faq
    echo "FAQPART=1" > ~/.lastfaq
   fi
  fi 
 fi
fi
rm /tmp/faq
rm xx*
cd $curdir
