summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2014-11-24 18:16:36 +0000
committerFrancis Rowe <info@gluglug.org.uk>2014-11-24 18:16:36 +0000
commit7b1b072d9aef3da652eca8d9fb038740c3c8fd53 (patch)
treec62cad400d2a00618fb441882fde883527b6fb28
parent1ae732e2a7f4f214c772f27a292a3a7270cb3f4f (diff)
flash: check if user is root
-rwxr-xr-xflash5
1 files changed, 5 insertions, 0 deletions
diff --git a/flash b/flash
index 91d4b87..fdc13d6 100755
--- a/flash
+++ b/flash
@@ -22,6 +22,11 @@
# set -u -e -v
set -v
+if [[ $EUID -ne 0 ]]; then
+ echo "This script must be run as root"
+ exit 1
+fi
+
# USE ROOT OR SUDO WHEN EXECUTING THIS
# uses flashrom to flash the rom