I have a directory, lets call it foo, and inside of foo there are N directories, bar1..barN. Inside of each directory there can be 1..N files all files are gpg encrypted. What I want is to decrypt all of the files in each folder.
#!/bin/bash
for d in *; do
cd $d
pwd
mkdir gpg
for fn in *.gpg; do
n=${fn##*/}
f=${n%.gpg}
gpg --homedir ~/Documents/gpg/ -u MY_PVT_KEY_NAME -do $f.txt $fn
mv $fn gpg
done
cd ..
done
For some reason the only directory that is processed properly is the first one the rest of them fail to decrypt, the files are moved into the gpg directory, but files are not decrypted.
Thanks for any help.