mkarchroot: move check for root below option parsing

This way people can at least see the usage instructions.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2007-10-11 07:37:23 -05:00
parent 67dc59299a
commit a6863ff7cb
1 changed files with 6 additions and 5 deletions

View File

@ -15,11 +15,6 @@ working_dir=""
APPNAME=$(basename "${0}")
if [ "$EUID" != "0" ]; then
echo "error: this script must be run as root."
exit 1
fi
# usage: usage <exitvalue>
usage ()
{
@ -41,6 +36,12 @@ while getopts 'r:ufh' arg; do
*) echo "invalid argument '${arg}'"; usage 1 ;;
esac
done
if [ "$EUID" != "0" ]; then
echo "error: this script must be run as root."
exit 1
fi
shift $(($OPTIND - 1))
if [ "$RUN" == "" -a $# -lt 2 ]; then