]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Clean empty directories once the files are removed with shred
authorGrégoire Jadi <gjadi@omecha.info>
Wed, 28 Mar 2018 10:08:21 +0000 (12:08 +0200)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 30 May 2018 17:38:13 +0000 (14:38 -0300)
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>
lib/keyringer/functions

index b8f91a7923a76cc2a40b03ff5e12eaa48a6e4dac..72286ff7eeaca01f4bc7df8668ed3510089444f3 100755 (executable)
@@ -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