Import initial du script de Manuel Sabban pour rparer l'overview

(stransky)

darcs-hash:20021123180554-a279a-61c2c48c702abc24b2ef1dd6edd0c6c32c198ff0.gz
This commit is contained in:
stransky 2002-11-23 19:05:54 +01:00
parent 1bb44ab4cc
commit 5f74981119

37
fix-overview Executable file
View file

@ -0,0 +1,37 @@
#!/bin/bash
if [ $UID != 0 ]; then
echo "Il faut être root pour lancer ce script"
exit 1
fi
# /etc/init.d/inn2 stop
(awk -F: -f - /etc/news/buffindexed.conf <<EOF""
($0 !~ /^#/ && NF == 3) {
print "su news -c \"dd if=/dev/zero of="$2" bs=1k count="$3"\""
}
EOF
) | sh
if [ $? != 0 ]; then
echo "Impossible d'écraser l'overview"
exit 1
fi
cd /var/lib/news
(awk -F£ '{ printf "su news -c \"" ; if ($1 == 1) printf "/usr/lib/news/bin/" ; printf $2"\" ; if [ $? != 0 ]; then echo \"Erreur pour la commande "NR"\" ; exit 2 ; fi\n"}' <<EOF""
1£makehistory -b -f history.n -O -l 30000 -I
0£awk 'NF == 2 { print }' < history >> history.n
1£makedbz -s $(wc -l < history) -f history.n
0£mv -f history.n history
0£mv -f history.n.dir history.dir
0£mv -f history.n.hash history.hash
0£mv -f history.n.index history.index
EOF
) | sh
echo "OK, redemarrage de INN"
# /etc/init.d/inn2 start