diff options
Diffstat (limited to 'wipedisk')
| -rw-r--r-- | wipedisk | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/wipedisk b/wipedisk deleted file mode 100644 index 0c08c72..0000000 --- a/wipedisk +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -# Craig Jennings <c@cjennings.net> -# identify disk and erase - -all_disk_ids=( $(ls /dev/disk/by-id/) ) -echo ""; echo "Select the disk id to use. All data will be erased." -select disk_id in "${all_disk_ids[@]}"; do - # ensure valid selection - if [[ -n $disk_id ]]; then - selection=$disk_id - break - else - echo "Invalid. Try again." - fi -done - -# Confirm the selected disk -read -p "Confirm: '$selection' [y/n]? " choice -if [[ "$choice" != "y" ]]; then - echo "Exiting..." - exit 1 -fi - -DISK="/dev/disk/by-id/$selection" -echo ""; echo "### Erasing Disk" -blkdiscard -f "${DISK}" || true # discard all sectors on flash-based storage -sgdisk --zap-all "${DISK}" # clear the disk - -echo "" -echo "Disk erased."
\ No newline at end of file |
