From bb426c9e71cfdc3b9ea882d1b93a9359ae7eab92 Mon Sep 17 00:00:00 2001 From: "Peter J. Philipp" Date: Sat, 19 Aug 2017 16:07:26 +0200 Subject: [PATCH] Check for root and bail out if the user is root. Signed-off-by: Peter J. Philipp Reviewed-by: Tim Niemeyer --- buildscript | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/buildscript b/buildscript index f6d6297..06f88c3 100755 --- a/buildscript +++ b/buildscript @@ -373,6 +373,11 @@ buildall() { done } +if [ "$(/usr/bin/id -u)" -eq 0 ]; then + echo "don't run buildscript as root" + exit 1 +fi + if [ "$1" != "selectbsp" -a "$1" != "selectcommunity" ]; then if [ ! -h selected_bsp ]; then echo "Please select a Board-Support-Package using:"