From 48b6de4acac01f672700ff127638131f4aa28a52 Mon Sep 17 00:00:00 2001 From: Liam McLoughlin Date: Sat, 21 Apr 2012 14:21:53 +0100 Subject: [PATCH] Add check for root --- rpi-update | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rpi-update b/rpi-update index 47f4b88..a129822 100755 --- a/rpi-update +++ b/rpi-update @@ -6,6 +6,12 @@ FW_RAM=${1:-224} FW_GPU=$((256-FW_RAM)) echo "Raspberry Pi firmware updater by Hexxeh" + +if [[ $EUID -ne 0 ]]; then + echo "This tool must be run as root" 1>&2 + exit 1 +fi + echo "Using memory split of ${FW_RAM}MB/${FW_GPU}MB" GITCMD="git --git-dir=${FW_PATH}/.git --work-tree=${FW_PATH}"