shred instead of rm

This commit is contained in:
ville rantanen
2016-08-31 12:30:41 +03:00
parent b7009615dc
commit d6a30184c6

View File

@@ -18,6 +18,8 @@ Changed file is always backed up as .old
} }
[[ -z "$1" ]] && helpexit [[ -z "$1" ]] && helpexit
[[ "$1" = "-h" ]] && helpexit [[ "$1" = "-h" ]] && helpexit
RM=rm
which shred &> /dev/null && RM="shred -u"
set -x set -x
if [[ ! "$1" == *\.gpg ]] if [[ ! "$1" == *\.gpg ]]
then then
@@ -40,7 +42,7 @@ edit=`date +%s -r $unc`
if [ -s "$unc" ] if [ -s "$unc" ]
then vim -i NONE -n "$unc" then vim -i NONE -n "$unc"
else echo Error in decrypting else echo Error in decrypting
rm "$unc" $RM "$unc"
exit 1 exit 1
fi fi
@@ -54,4 +56,4 @@ then
mv -f "$1".tmp "$1" mv -f "$1".tmp "$1"
fi fi
fi fi
rm "$unc" $RM "$unc"