Skip to contentSkip to conversation

cubieboard: mkcubiecard: use the right command for checking user privilege

PATCH New Andi Shyti 2 participants 2 messages Dec 2, 2013 – Dec 3, 2013

lore
Share & tools
lore

Andi Shyti

author
#0 lore raw

PATCH 1/1 cubieboard: mkcubiecard: use the right command for checking user privilege

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

---
 board/cubietech/cubieboard/mkcubiecard.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/cubietech/cubieboard/mkcubiecard.sh +1 -1
index 34afc87..f1d5a9f 100755
@@ -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
Signature · 1 line
1.8.4.4
#1 lore raw

PATCH 1/1 cubieboard: mkcubiecard: use the right command for checking user privilege

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Andi" == Andi Shyti <[email protected]> writes:

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

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard