Check for root and bail out if the user is root.

Signed-off-by: Peter J. Philipp <freifunk@centroid.eu>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
This commit is contained in:
Peter J. Philipp 2017-08-19 16:07:26 +02:00 committed by Tim Niemeyer
parent fb8290b8ec
commit bb426c9e71
1 changed files with 5 additions and 0 deletions

View File

@ -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:"