Identation and end status + 500M step

This commit is contained in:
MatMoul 2024-05-07 02:06:22 +02:00
parent 87be64e61b
commit 8504eafa48

View File

@ -1,6 +1,7 @@
#!/bin/bash
declare -r DEV="${1}"
declare STARTDATE="$(date)"
show_help() {
echo "ddwipe dev (/dev/sdX)"
@ -39,13 +40,13 @@ wipe_dev() {
echo "Begin wiping device ${1}"
echo ""
echo "Start date :"
date
echo "${STARTDATE}"
echo ""
echo "blkdiscard secure"
if ! blkdiscard -f -p 100G -s -v "${1}"; then
if ! blkdiscard -f -p 500M -s -v "${1}"; then
echo ""
echo "blkdiscard zero"
if ! blkdiscard -f -p 100G -z -v "${1}"; then
if ! blkdiscard -f -p 500M -z -v "${1}"; then
echo ""
echo "dd zero"
if ! dd if=/dev/zero of="${1}" bs=1M status=progress; then
@ -63,6 +64,10 @@ wipe_dev() {
}
print_time() {
echo ""
echo "Start date :"
echo "${STARTDATE}"
ENDDATE=$(date +%s)
echo ""
echo "End date :"