]> diplodocus.org Git - nmh/blob - docs/historical/mh-6.8.5/support/general/pgped.sh
Simplify folder_exists() to just testing stat(2)'s return value.
[nmh] / docs / historical / mh-6.8.5 / support / general / pgped.sh
1 : run this script through /bin/sh
2
3 if [ "$1" = -sign ]; then
4 FLAGS=sat
5 TEXT=T
6 shift
7 else
8 FLAGS=esat
9 TEXT=F
10 fi
11
12 if [ "$#" != 1 ]; then
13 echo "usage: What now? ed pgped" 1>&2
14 exit 1
15 fi
16 DRAFT=$1
17
18 trap "rm -f $DRAFT.1 $DRAFT.2 $DRAFT.2.asc" 0 1 2 3 13 15
19
20 USERS="`stclsh -nointerface -messaging -messagebody $DRAFT -file @LIB/pgped.tcl $DRAFT.1 $DRAFT.2 $TEXT`"
21
22 if [ ! -s $DRAFT.1 -o ! -s $DRAFT.2 ]; then
23 exit 1
24 fi
25
26 if pgp -$FLAGS $DRAFT.2 $USERS; then
27 mv $DRAFT `dirname $DRAFT`/,`basename $DRAFT`
28
29 cat $DRAFT.1 $DRAFT.2.asc > $DRAFT
30
31 exit 0
32 fi
33
34 exit 1