From daaad90b78ad3c41677e47dbffbf02aeddd02c69 Mon Sep 17 00:00:00 2001 From: Paul Whalen Date: Oct 13 2016 15:46:04 +0000 Subject: Add sudo check to rpi script. --- diff --git a/rpi-uboot-update b/rpi-uboot-update index 908d199..fe44b88 100755 --- a/rpi-uboot-update +++ b/rpi-uboot-update @@ -1,5 +1,11 @@ #!/bin/bash +# ensure sudo user +if [ "$(whoami)" != "root" ] ; then + echo "Error: This script requires 'sudo' privileges in order to write to disk & mount media." + exit 1 +fi + echo echo "= This will update U-Boot and the " echo "= Raspberry Pi Firmware to the latest."