cubieboard: mkcubiecard: use the right command for checking user privilege
authorAndi Shyti <andi@etezian.org>
Mon, 2 Dec 2013 13:46:07 +0000 (14:46 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Tue, 3 Dec 2013 11:17:20 +0000 (12:17 +0100)
On some shell environments the EUID variable, which checks the
user id, is not defined. Use `id -u` instead.

This patch mutes the following error:

./board/cubietech/cubieboard/mkcubiecard.sh: 31: [: -ne: unexpected operator

Signed-off-by: Andi Shyti <andi@etezian.org>
Reviewed-by: Arvid Picciani <aep@exys.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
board/cubietech/cubieboard/mkcubiecard.sh

index 34afc87088b1896bfe0fcc67898f6651a01ae353..f1d5a9fb45c67ed8c4dbc283fd4d0b2f14a06f56 100755 (executable)
@@ -28,7 +28,7 @@ if [ $# -ne 2 ]; then
        exit 1;
 fi
 
-if [ $EUID -ne 0 ]; then
+if [ `id -u` -ne 0 ]; then
        echo "This script must be run as root" 1>&2
        exit 1
 fi