From 27d5a031ffff5dd86fd1c97e3c05e0f1326a6c2b Mon Sep 17 00:00:00 2001 From: Silvan Date: Thu, 5 Dec 2024 23:54:55 +0100 Subject: [PATCH] sb-setup: add check that script is run as root --- sb-setup/sb-setup | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sb-setup/sb-setup b/sb-setup/sb-setup index 10b748a..ad387f4 100755 --- a/sb-setup/sb-setup +++ b/sb-setup/sb-setup @@ -23,6 +23,11 @@ QUIET= [ "$QUIET" ] || echo "Secure boot setup script for openmamba" +[ $UID -eq 0 ] || { + echo "This script must be run as root; exiting." + exit 1 +} + [ "$SECUREBOOT_ENABLED" == "00000001" ] || { [ "$QUIET" ] || echo "Secure Boot is not enabled; exiting." exit 0