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 "be run as root."
|
||||||
echo
|
echo
|
||||||
echo "erase-disk.sh is licensed under The Unlicense."
|
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
|
if [ $# -lt 2 ]; then
|
||||||
echo "This script must be run as root. Quitting..."
|
echo "ERROR: Not enough options!"
|
||||||
|
echo
|
||||||
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
elif [ -z "$1" ]; then
|
elif [ $# -gt 2 ]; then
|
||||||
echo "Please specify number of passes. Quitting..."
|
echo "ERROR: Too many options!"
|
||||||
|
echo
|
||||||
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
elif [ -z "$2" ]; then
|
elif [ $(id -u) -ne 0 ]; then
|
||||||
echo "Please specify device to erase. Quitting..."
|
echo "ERROR: Must run as root!"
|
||||||
|
echo
|
||||||
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue