Skip to content

Commit

Permalink
Merge pull request #20 from staticfloat/sf/safe_shred
Browse files Browse the repository at this point in the history
Don't attempt to shred missing files
  • Loading branch information
staticfloat authored Feb 3, 2022
2 parents a65cb27 + 7190b2c commit e1c65a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ fi
# Figure out the best way to securely delete something
if [[ -n "$(which shred 2>/dev/null)" ]]; then
function secure_delete() {
shred -u "$*"
for f in "$@"; do
if [[ -e "${f}" ]]; then
shred -u "${f}"
fi
done
}
elif [[ "$(uname)" == "Darwin" ]] || [[ "$(uname)" == *BSD ]]; then
function secure_delete() {
Expand Down

0 comments on commit e1c65a6

Please sign in to comment.