From a6863ff7cbbf60cfabf7d2e1ba3cdb1d95c8eca4 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 11 Oct 2007 07:37:23 -0500 Subject: mkarchroot: move check for root below option parsing This way people can at least see the usage instructions. Signed-off-by: Dan McGee --- mkarchroot | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mkarchroot b/mkarchroot index be93209..d735cf0 100755 --- a/mkarchroot +++ b/mkarchroot @@ -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 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 -- cgit v1.2.2