Skip to content

Instantly share code, notes, and snippets.

@kfatehi
Created July 23, 2012 23:16
Show Gist options
  • Save kfatehi/3166865 to your computer and use it in GitHub Desktop.
Save kfatehi/3166865 to your computer and use it in GitHub Desktop.
#!/bin/bash
function wipe_it() {
echo "Alright, here we go. ZEROING EVERYTHING"
echo "Yeah right, execute this yourself: sudo dd if=/dev/zero of=/dev/mapper/sick-root bs=1M"
}
function confirm_it() {
read -n1 -p "Are you absolutely SURE you want to zero the drive? (y/n): "
echo
[[ $REPLY = [yY] ]] && wipe_it || { echo "Bailing!"; exit 1; }
}
read -n1 -p "Really wipe everything? (y/n): "
echo
[[ $REPLY = [yY] ]] && confirm_it || { echo "Bailing!"; exit 1; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment