diff options
author | Dan McGee <dan@archlinux.org> | 2007-10-11 14:37:23 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-10-30 03:31:16 +0100 |
commit | a6863ff7cbbf60cfabf7d2e1ba3cdb1d95c8eca4 (patch) | |
tree | 2f7f0fd421b08e79c7ca6edd53ac1bcb978ef3dd /mkarchroot | |
parent | 67dc59299a72d8165c4fef3a5cad213bcf34f78b (diff) | |
download | devtools-a6863ff7cbbf60cfabf7d2e1ba3cdb1d95c8eca4.tar.gz devtools-a6863ff7cbbf60cfabf7d2e1ba3cdb1d95c8eca4.tar.xz |
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>
Diffstat (limited to 'mkarchroot')
-rwxr-xr-x | mkarchroot | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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 |