3 # JM にステータスその他をポストするコマンド
4 # パスの通ったディレクトリに tr と nkf が必要です.
9 # もし bash コマンドが /usr/bin/bash でない場合は、
12 # 名前とメールアドレス。自分専用で使うときには
16 #mail="linuxjm-discuss@lists.sourceforge.jp"
18 # sendmail コマンド。置き場所が違う場合は書き換えてください。
20 sendmail="/usr/lib/sendmail"
24 jmaddr="linuxjm-discuss@lists.sourceforge.jp"
28 TMPF="/var/tmp/jm.$$.tmp"
30 while getopts 'S:P:F:D:M:R:p:' opt; do
39 '?') cat << EOB > /dev/stderr
40 usage: `basename $0` [-S stat] [-P pkg] [-F page] [-D date]
41 [-M mail] [-R name] filename [-post]
42 -S: page status (one of: TR, DO, DP, PR, RO)
43 -P: package name the page belongs to (please quote if space is included)
44 -F: filename of the manual
45 -D: date string YYYY/MM/DD (today, if ommited)
46 -M: Posters mail address
47 -R: Posters real name (please quote if space is included)
49 filename can be ommitted when status is "TR" or "PR".
51 if -post flag is specified at last, output is post to JM-ML.
52 Otherwise, output is sent to stdout.
58 shift `expr $OPTIND - 1`
60 if [ ${stat:=undef} = "undef" ]; then
61 echo "Input Page Status" > /dev/stderr
62 echo " TR: Translation Reservation" > /dev/stderr
63 echo " DO: Draft Only (without proof reservation)" > /dev/stderr
64 echo " DP: Draft and Proof reservation" > /dev/stderr
65 echo " PR: Proof Reservation" > /dev/stderr
66 echo " RO: Release" > /dev/stderr
67 echo -n "Input a one ov above : " > /dev/stderr
70 stat=`echo $stat | tr a-z A-Z`
75 if (echo $stat | egrep -q '^[DR]'); then
76 if [ ! -f "$1" ]; then
77 echo "Sorry, file $1 does not exist"
85 if [ "${ppkg:=undef}" = "undef" ]; then
86 echo -n "Package name of the page? : " > /dev/stderr
90 if [ ${page:=undef} = "undef" ]; then
91 echo -n "Page Filename (as hoge.1)? : " > /dev/stderr
95 if [ ${date:=undef} = "undef" ]; then
96 date=`date "+%Y/%m/%d"`
100 # poster's information
102 if [ ${mail:=undef} = "undef" ]; then
103 echo -n "Your email address? : " > /dev/stderr
107 if [ "${name:=undef}" = "undef" ]; then
108 echo -n "Your Real Name? : " > /dev/stderr
115 Subject: [POST:$stat] $ppkg $page
128 if (echo $stat | egrep -q '^[DR]'); then
133 # 入力に . だけの行があったらエラーメッセージを出して終了する.
135 if (grep -q "^\.$" $TMPF); then
136 cat << EOL > /dev/stderr
137 The input contains the line which has a period solely.
138 It will break the sendmail, and will not be formatted
139 by groff as you want. Please use "\&." instead.
146 # 最後の argument まで shift する。
148 while [ "$#" -gt 1 ]; do
153 # write to file or post:
155 if [ "$1" = "-post" -o "$post" = "ost" ]; then
156 nkf -j $TMPF | $sendmail $jmaddr