#!/bin/ksh
#
# $Revision: 1.6 $ $Date: 2012-11-30 19:58:56-05 $
# $Source: /home/vogelke/bin/RCS/mcrypt,v $
# $Host: sys7.com $
# $UUID: c863256c-1b50-3181-8b64-ceae84804bf9 $
#
#<mcrypt: driver for compiled binaries mcrypt/mdecrypt.
# use default key if none is set on command line.

export PATH=/usr/local/bin:/bin:/usr/bin
tag="${0##*/}"

die () {
    echo "$tag: $*" >& 2
    exit 1
}

case "$#" in
    0)  die "usage: $0 file" ;;
    *)  ;;
esac

if test -f "$HOME/.mcenv"; then
    . $HOME/.mcenv
else
    export MCRYPT_ALGO=blowfish
    export MCRYPT_MODE=cbc
fi

# link this script as mcrypt/mdecrypt
exec $tag ${1+"$@"}
exit 0
