Posts Tagged ‘ pgp batch

12 Dec 2008

Pgp Batch Posted by Insane in Bash, Linux | No responses

I`ve made the following script , it decrypts all pgp/encrypted files and then move them into another folder. I hope it helps someone. #!/bin/bash decryptEmAll(){ #file that contains your passphrase. declare -r pfile='/pf0.dat'; #where to move the decrypted files. declare -r outputFolder='/blackhole/'; for i in `ls /yourpath/*.pgp`; do echo "----------------------------------------------------\n"; #build the command. cmd="cat $pfile" cmd="${cmd}|" cmd="$cmd /usr/bin/gpg --batch --no-tty --yes --passphrase-fd=0 " cmd="$cmd --output $outputFolder${i/\.pgp/} " cmd="$cmd --decrypt /yourpath/${i}" eval $cmd echo [...]

Tags:, , ,