#! /bin/sh

set -e

echo -n "Regenerating the indices in /var/spool/sn ... "
cd /var/spool/sn
touch .noservice
pkill -HUP snntpd.bin
rm -f .newsgroup .table .chain
find . -type f -name "+*" -exec rm -f {} \;
/usr/sbin/snprimedb -i
/usr/sbin/snscan -n * | /usr/sbin/snprimedb
rm -f .noservice
echo "done."
