File: .encrypt~

package info (click to toggle)
pinepgp 3.7
  • links: PTS
  • area: contrib
  • in suites: potato
  • size: 120 kB
  • ctags: 8
  • sloc: sh: 203; makefile: 52
file content (52 lines) | stat: -rw-r--r-- 1,043 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
if [ "$USEPGP5" = "TRUE" ]; then
  cmd="pgpk -l"
else
  cmd="pgp +LANGUAGE=en -kv"
fi

. /usr/lib/pinepgp/.get_key

function check_key() {
  $cmd $TO 2> /dev/null > $PGPPATH/tmp.res
  RES=`grep "1 matching key found" $PGPPATH/tmp.res`
  if [ -z "$RES" ]; then
    echo
    if [ ! -z "`grep "0 matching keys found" $PGPPATH/tmp.res`" ]; then
      echo "Unable to find public key for $TO"
    else
      cat $PGPPATH/tmp.res
    fi
    echo
    echo "Type 'finger' to finger for public key."
    echo -n "[default = abort] Try a different PGP user-id: "; read answer
    echo
    if [ "$answer" = "finger" ]; then
      get_key
      check_key
    elif [ ! -z "$answer" ]; then
      TO=$answer
      check_key
    else
      TO=$answer
    fi
  fi
  rm -f $PGPPATH/tmp.res
}

TOS=""
shift
for i in $*; do
  TO="$i"
  check_key
  if [ -z "$TO" ]; then
    exit -1
  fi
  TOS="$TOS $TO"
done

if [ ! -z "$TOS" ]; then
  pgp="pgp +LANGUAGE=en -ea $MSG -o $PGPPATH/tmp.msg $TOS"
  pgp5="pgpe -a -r $TOS -o $PGPPATH/tmp.msg $MSG"
else
  exit -1
fi