Identation and end status + 500M step
This commit is contained in:
parent
87be64e61b
commit
8504eafa48
11
mtm-ddwipe
11
mtm-ddwipe
@ -1,6 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
declare -r DEV="${1}"
|
declare -r DEV="${1}"
|
||||||
|
declare STARTDATE="$(date)"
|
||||||
|
|
||||||
show_help() {
|
show_help() {
|
||||||
echo "ddwipe dev (/dev/sdX)"
|
echo "ddwipe dev (/dev/sdX)"
|
||||||
@ -39,13 +40,13 @@ wipe_dev() {
|
|||||||
echo "Begin wiping device ${1}"
|
echo "Begin wiping device ${1}"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Start date :"
|
echo "Start date :"
|
||||||
date
|
echo "${STARTDATE}"
|
||||||
echo ""
|
echo ""
|
||||||
echo "blkdiscard secure"
|
echo "blkdiscard secure"
|
||||||
if ! blkdiscard -f -p 100G -s -v "${1}"; then
|
if ! blkdiscard -f -p 500M -s -v "${1}"; then
|
||||||
echo ""
|
echo ""
|
||||||
echo "blkdiscard zero"
|
echo "blkdiscard zero"
|
||||||
if ! blkdiscard -f -p 100G -z -v "${1}"; then
|
if ! blkdiscard -f -p 500M -z -v "${1}"; then
|
||||||
echo ""
|
echo ""
|
||||||
echo "dd zero"
|
echo "dd zero"
|
||||||
if ! dd if=/dev/zero of="${1}" bs=1M status=progress; then
|
if ! dd if=/dev/zero of="${1}" bs=1M status=progress; then
|
||||||
@ -63,6 +64,10 @@ wipe_dev() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
print_time() {
|
print_time() {
|
||||||
|
echo ""
|
||||||
|
echo "Start date :"
|
||||||
|
echo "${STARTDATE}"
|
||||||
|
|
||||||
ENDDATE=$(date +%s)
|
ENDDATE=$(date +%s)
|
||||||
echo ""
|
echo ""
|
||||||
echo "End date :"
|
echo "End date :"
|
||||||
|
Loading…
Reference in New Issue
Block a user