diff --git a/scripts/.local/bin/erase-disk.sh b/scripts/.local/bin/erase-disk.sh index 859b5e3..f2ad2e0 100755 --- a/scripts/.local/bin/erase-disk.sh +++ b/scripts/.local/bin/erase-disk.sh @@ -20,20 +20,24 @@ usage() { echo "be run as root." echo echo "erase-disk.sh is licensed under The Unlicense." - - exit 0 } -[ "$1" = "-h" -o "$1" = "--help" ] && usage +[ "$1" = "-h" -o "$1" = "--help" ] && usage && exit 0 -if [ $(id -u) -ne 0 ]; then - echo "This script must be run as root. Quitting..." +if [ $# -lt 2 ]; then + echo "ERROR: Not enough options!" + echo + usage exit 1 -elif [ -z "$1" ]; then - echo "Please specify number of passes. Quitting..." +elif [ $# -gt 2 ]; then + echo "ERROR: Too many options!" + echo + usage exit 1 -elif [ -z "$2" ]; then - echo "Please specify device to erase. Quitting..." +elif [ $(id -u) -ne 0 ]; then + echo "ERROR: Must run as root!" + echo + usage exit 1 fi