pour corriger le fait que le vi tait lanc en root
darcs-hash:20020403212951-a279a-875b5c0516d88ccece0d91d21115fd84c31f05dc.gz
This commit is contained in:
parent
901e95f9ca
commit
d13748dc17
1 changed files with 14 additions and 7 deletions
21
news-cancel
21
news-cancel
|
@ -6,12 +6,18 @@
|
||||||
## Login stransky <stransky@crans.org>
|
## Login stransky <stransky@crans.org>
|
||||||
##
|
##
|
||||||
## Started on dim 13 jan 2002 02:30:56 CET Nicolas STRANSKY
|
## Started on dim 13 jan 2002 02:30:56 CET Nicolas STRANSKY
|
||||||
## Last update mer 27 fév 2002 02:28:58 CET Nicolas STRANSKY
|
## Last update mer 03 avr 2002 23:15:46 CEST Nicolas STRANSKY
|
||||||
##
|
##
|
||||||
## Script pour annuler ou modérer un message de news.
|
## Script pour annuler ou modérer un message de news.
|
||||||
#
|
#
|
||||||
# TODO : implémenter la possibilité de définir le message par un NG et un numéro.
|
# TODO : implémenter la possibilité de définir le message par un NG et un numéro.
|
||||||
|
|
||||||
|
if [[ "${ORIG_LOGNAME-$SUDO_USER}" = "" ]]
|
||||||
|
then moderateur=`who am i | awk '{print $1}'`
|
||||||
|
else moderateur=${ORIG_LOGNAME-$SUDO_USER}
|
||||||
|
fi
|
||||||
|
|
||||||
|
groupe=adm
|
||||||
|
|
||||||
VERIF () {
|
VERIF () {
|
||||||
ligne=`grep --binary-files=text " $1 " /var/spool/news/overview/OV1 | head -n 1 | awk -F "\t" '{print $1"~"$2"~"$3"~"$9}'`
|
ligne=`grep --binary-files=text " $1 " /var/spool/news/overview/OV1 | head -n 1 | awk -F "\t" '{print $1"~"$2"~"$3"~"$9}'`
|
||||||
|
@ -40,12 +46,12 @@ SAUVEGARDE () {
|
||||||
sleep 1
|
sleep 1
|
||||||
rep=`echo $newsgroup | sed 's/\./\//g'`
|
rep=`echo $newsgroup | sed 's/\./\//g'`
|
||||||
cp /var/spool/news/articles/$rep/$numero /root/moderes/$newsgroup'.'$numero.nws
|
cp /var/spool/news/articles/$rep/$numero /root/moderes/$newsgroup'.'$numero.nws
|
||||||
moderateur=`who am i | awk '{print $1}'`
|
|
||||||
echo "$1 de $newsgroup.$numero" > /tmp/news-cancel1.txt
|
echo "$1 de $newsgroup.$numero" > /tmp/news-cancel1.txt
|
||||||
echo " " >> /tmp/news-cancel1.txt
|
echo " " >> /tmp/news-cancel1.txt
|
||||||
echo "modérateur : $moderateur" >> /tmp/news-cancel1.txt
|
echo "modérateur : $moderateur" >> /tmp/news-cancel1.txt
|
||||||
echo "commentaires : " > /tmp/news-cancel-commentaires.txt
|
echo "commentaires : " > /tmp/news-cancel-commentaires.txt
|
||||||
$EDITOR /tmp/news-cancel-commentaires.txt
|
chown $moderateur.$groupe /tmp/news-cancel-commentaires.txt
|
||||||
|
/bin/su $moderateur -c "$EDITOR /tmp/news-cancel-commentaires.txt"
|
||||||
cat /tmp/news-cancel-commentaires.txt >> /tmp/news-cancel1.txt
|
cat /tmp/news-cancel-commentaires.txt >> /tmp/news-cancel1.txt
|
||||||
cat /tmp/news-cancel1.txt | mutt -nx -a /root/moderes/$newsgroup'.'$numero.nws -s "moderation de $newsgroup.$numero par $moderateur" moderateurs
|
cat /tmp/news-cancel1.txt | mutt -nx -a /root/moderes/$newsgroup'.'$numero.nws -s "moderation de $newsgroup.$numero par $moderateur" moderateurs
|
||||||
rm -f /tmp/news-cancel*
|
rm -f /tmp/news-cancel*
|
||||||
|
@ -54,17 +60,18 @@ SAUVEGARDE () {
|
||||||
|
|
||||||
|
|
||||||
EDITION () {
|
EDITION () {
|
||||||
$EDITOR /var/spool/news/articles/$rep/$numero
|
chown $moderateur.$groupe /var/spool/news/articles/$rep/$numero
|
||||||
|
/bin/su $moderateur -c "$EDITOR /var/spool/news/articles/$rep/$numero"
|
||||||
}
|
}
|
||||||
|
|
||||||
CANCEL () {
|
CANCEL () {
|
||||||
echo -n 'throttling inn... '
|
echo -n 'throttling inn... '
|
||||||
/bin/su - news -c "/usr/lib/news/bin/ctlinnd throttle 'article canceling'"
|
/bin/su news -c "/usr/lib/news/bin/ctlinnd throttle 'article canceling'"
|
||||||
echo "canceling article $1"
|
echo "canceling article $1"
|
||||||
/bin/su - news -c "/usr/lib/news/bin/ctlinnd cancel $1"
|
/bin/su news -c "/usr/lib/news/bin/ctlinnd cancel $1"
|
||||||
|
|
||||||
echo -n 'starting inn... '
|
echo -n 'starting inn... '
|
||||||
/bin/su - news -c "/usr/lib/news/bin/ctlinnd go ''"
|
/bin/su news -c "/usr/lib/news/bin/ctlinnd go ''"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue