summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-12-30 21:20:10 +0000
committerSean Whitton <spwhitton@spwhitton.name>2019-12-30 21:20:10 +0000
commitc37f1383c62f53f323f13acc9802ed50135b3be4 (patch)
tree2f60090e3bb349b4b96770d435979f96f6778b2f
parentee5db85224ab31ef290ab64022c0813fd7241a33 (diff)
downloaddotfiles-c37f1383c62f53f323f13acc9802ed50135b3be4.tar.gz
ata-secure-erase: improve terminal output
-rwxr-xr-xbin/ata-secure-erase8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/ata-secure-erase b/bin/ata-secure-erase
index c47f5092..17ec49b7 100755
--- a/bin/ata-secure-erase
+++ b/bin/ata-secure-erase
@@ -22,7 +22,7 @@ set -x
device=""
! test -z "$device"
-mount | grep -v "$device"
+mount | grep -qv "$device"
# sudo scrub "$device" # in case the ATA secure erase actually just
# # bricks the device, first erase the device
@@ -37,9 +37,11 @@ mount | grep -v "$device"
sudo hdparm -I "$device" | grep "not frozen"
sudo hdparm --user-master u --security-set-pass Eins "$device"
-sudo hdparm -I "$device" | grep -v "not enabled"
+sudo hdparm -I "$device" | grep -qv "not enabled"
# drive may not support --security-erase-enhanced and so might need to
# change following line to use --security-erase
+date
sudo time hdparm --user-master u --security-erase-enhanced Eins "$device"
-sudo hdparm -I "$device" | grep "not enabled"
+sudo hdparm -I "$device" | grep -q "not enabled"
+date