#/bin/bash #script encrypts pdf file w/base name $1 from non URL download dir #the password is the given password it is passed as $2 #the user-created name (hopefully valid email) is passed as $3 #check the args DOWNLOAD_DIR=/home/platypus/downloadable THIS_DIR=/home/colleenweb.com/lpd/wbx #copy the files from the download dir into this dir cp $DOWNLOAD_DIR/$1.pdf $THIS_DIR #$1 hardcoded as LaughPoopDie in this case #it gets copied here temporarily so it doesn't have a URL #now encrypt /usr/local/java/bin/java -cp itext-1.3.jar com.lowagie.tools.encrypt_pdf $1.pdf $1qe.pdf $2 iJ3039Xfq 10000100 128 #now zip up the copy /usr/bin/zip $1-4$3.zip $1qe.pdf README.txt #delete the temporary both copy of original and encrypted rm $1*.pdf #move the zip to the tmp dir where the program will pick up and send to user mv *.zip /tmp exit 0;