From 1285db82ee19ee16884288cfc419e9a40f0dbf67 Mon Sep 17 00:00:00 2001 From: Hari Sekhon Date: Fri, 8 Mar 2024 01:28:48 +0000 Subject: [PATCH] updated shred_free_space.sh --- bin/shred_free_space.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/shred_free_space.sh b/bin/shred_free_space.sh index f26a7fca..94c89a16 100755 --- a/bin/shred_free_space.sh +++ b/bin/shred_free_space.sh @@ -78,15 +78,16 @@ tmpfile="shredfile.binary" trap_cmd "if [ -f \"$tmpfile\" ]; then timestamp 'Removing tmpfile \"$tmpfile\"'; rm -f \"$tmpfile\"; fi" -bs='1m' -if uname -s | grep -q Darwin; then - bs='1M' -fi +# mac can use 1m or 1M but Linux dd requires 1M capitalized +#bs='1m' +#if uname -s | grep -q Darwin; then +# bs='1M' +#fi timestamp "Writing tmpfile '$PWD/$tmpfile'" for (( i = 0; i < passes; i++ )); do timestamp "overwrite pass 1..." - dd if=/dev/urandom of="shredfile.binary" bs="$bs" || : # will hit out of space error and error out otherwise + dd if=/dev/urandom of="shredfile.binary" bs="1M" || : # will hit out of space error and error out otherwise timestamp "Removing tmpfile '$tmpfile'" rm -f "$tmpfile" done