Scripts: Fix error messages in erase-disk.sh
This commit is contained in:
parent
7dd2d85547
commit
b29b88621c
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue