chiark / gitweb /
Fix up validation scripts so that they more or less work: don't hardcode
[bin.git] / Pnews-wrapper
1 #! /bin/sh
2
3 if grep '^Newsgroups:.*alt\.fan\.eddings\.creative' $2; then
4   get-sig afec > ~/.news_sig
5 elif grep '^Newsgroups:.*alt\.fan\.eddings' $2; then
6   get-sig afe > ~/.news_sig
7 else
8   get-sig general > ~/.news_sig
9 fi
10
11 if grep '^Newsgroups:.*riva.lists' $2; then
12   cat <<EOF
13 You almost certainly don't want to do this. Reply by mail instead ('R').
14 EOF
15   sleep 1
16   exit 1
17 fi
18
19 if [ "X$1" = X-h ] && grep '^References: ' $2 > /dev/null; then
20   echo ""
21   echo -n "Remove original poster's .signature (if present)? [yn] "
22   read ans
23   case $ans in
24     n*) ;;
25     *)  sed -n -e "/^\($QUOTECHARS\)\?-- \$/q" -e p $2 | sponge $2
26         ;;
27   esac
28 fi
29
30 exec Pnews "$@"