|
|
|
@ -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
|
|
|
|
|