summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrégoire Jadi <gjadi@omecha.info>2018-03-28 12:08:21 +0200
committerSilvio Rhatto <rhatto@riseup.net>2018-05-30 14:38:13 -0300
commit15b2331aafcb65e38021f0879a90bd45a7a1ead5 (patch)
tree13b574961c6e99f251ba806e49e5746197d29442 /lib
parent1ebdb9e0259f221a93f98b3c4c6c733aa4b60199 (diff)
downloadkeyringer-15b2331aafcb65e38021f0879a90bd45a7a1ead5.tar.gz
keyringer-15b2331aafcb65e38021f0879a90bd45a7a1ead5.tar.bz2
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 <rhatto@riseup.net>
Diffstat (limited to 'lib')
-rwxr-xr-xlib/keyringer/functions3
1 files changed, 2 insertions, 1 deletions
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