From patchwork Sat Aug 19 14:07:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Check for root and bail out if the user is root. From: "Peter J. Philipp" X-Patchwork-Id: 429 Message-Id: <20170819140726.9080-1-freifunk@centroid.eu> To: franken-dev@freifunk.net Cc: "Peter J. Philipp" Date: Sat, 19 Aug 2017 16:07:26 +0200 Signed-off-by: Peter J. Philipp Reviewed-by: Tim Niemeyer --- buildscript | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/buildscript b/buildscript index f6d6297..01da2eb 100755 --- a/buildscript +++ b/buildscript @@ -373,6 +373,12 @@ 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:"