#!/bin/sh
# masscrypt <crypt key>
# Shell script by Daark.  The creators of PGP had nothing to do with
# this script.
# Uses PGP to encrypt the current directory and all those below it.
# Good to use if you expect... trouble.  HINT! You might want to have
# PGP around.  This is basically a panic button, try using cryptdir
# for non-emergency situations.

# YOU MUST HAVE YOUR ENVIRONMENTAL VARIABLE SET:
# setenv PGPPASSFD 0

case "$1" in
"") echo "Usage: masscrypt <crypt key>" 1>&2 ;exit 0
esac

find . -type f -print > pgptmpfileslist

for filename in `cat pgptmpfileslist` 
do
  if echo $filename | grep .pgp$ > /dev/null
    then
      echo "Skipping file: already encrypted."
    else
      echo $1 | pgp -wc $filename  
  fi
done

wipe -d pgptmpfileslist
wipe -d pgptmpfileslist.pgp