PREUN
/bin/sh
if [ $1 = 0 ]; then
/sbin/chkconfig --del innd
if [ -f /var/lib/news/history.dir ]; then
rm -f /var/lib/news/history.*
fi
fi
POSTIN
/bin/sh
/sbin/chkconfig --add innd
umask 002
touch /var/log/news/news.notice
touch /var/log/news/news.crit
touch /var/log/news/news.err
[ -f /var/lib/news/active.times ] || {
touch /var/lib/news/active.times
chown news.news /var/lib/news/active.times
}
chown -R news.news /var/log/news*
if [ `cat /etc/news/inn.conf | grep '^server:' | wc -l` -lt 1 ]; then
echo "server: `hostname -f`" >> /etc/news/inn.conf
fi
if [ -f /var/lib/news/history ]; then
cd /var/lib/news
/usr/bin/makehistory -i -r
for i in dir hash index pag; do
[ -f history.n.$i ] && mv history.n.$i history.$i
done
chown news.news history.*
chmod 644 history.*
else
cd /var/lib/news
cp /dev/null history
/usr/bin/makehistory -i
for i in dir hash index pag; do
[ -f history.n.$i ] && mv history.n.$i history.$i
done
chown news.news history history.*
chmod 644 history history.*
fi