#!/bin/sh
# cryptdir <crypt key>
# Shell script by Daark.  The creators of PGP had nothing to do with
# this script.
# Uses PGP to encrypt the current directory but NOT those below it.
# Good to use if you expect... trouble.  HINT! You might want to have
# PGP around....

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

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

find . -type f -maxdepth 1 -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 > /dev/null
wipe -d pgptmpfileslist.pgp > /dev/null