From: Grégoire Jadi Date: Wed, 28 Mar 2018 10:08:21 +0000 (+0200) Subject: Clean empty directories once the files are removed with shred X-Git-Tag: 0.5.3~2 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=15b2331aafcb65e38021f0879a90bd45a7a1ead5;p=keyringer.git Clean empty directories once the files are removed with shred shred can only remove files. Use rm to cleanup the directories once all files have been erased. Signed-off-by: Silvio Rhatto --- diff --git a/lib/keyringer/functions b/lib/keyringer/functions index b8f91a7..72286ff 100755 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -217,7 +217,8 @@ function keyringer_shred { if [ "$tool" == "wipe" ] || [ "$tool" == "rm" ] || [ "$tool" == "rm -P" ]; then $tool -rf $path else - find $path -exec $tool -uf {} \; + find $path -type f -exec $tool -uf {} \; + find -d $path -type d -exec rmdir {} \; fi else if [ "$tool" == "wipe" ] || [ "$tool" == "rm" ] || [ "$tool" == "rm -P" ]; then