From e7f62d191cb4db65760136279b20d3f4a907b041 Mon Sep 17 00:00:00 2001 From: Nikhil Jha Date: Feb 18 2020 22:20:44 +0000 Subject: check for root in selftest --- diff --git a/00-selftest.sh b/00-selftest.sh index 0a8695b..386332e 100644 --- a/00-selftest.sh +++ b/00-selftest.sh @@ -11,6 +11,11 @@ infecho () { infecho "Now running selftest, please do not continue running scripts until this completes successfully." +if [[ $EUID -ne 0 ]]; then + errecho "This script must be run as root!" + exit 1 +fi + command -v mkfs.f2fs >/dev/null 2>&1 || { echo >&2 "I require mkfs.f2fs but it's not installed. Aborting."; exit 1; } command -v qemu-aarch64-static >/dev/null 2>&1 || { echo >&2 "I require qemu-aarch64-static but it's not installed. Aborting."; exit 1; } command -v rsync >/dev/null 2>&1 || { echo >&2 "I require rsync but it's not installed. Aborting."; exit 1; }