sb-setup: add check that script is run as root

This commit is contained in:
Silvan 2024-12-05 23:54:55 +01:00
parent a72d7dcd9c
commit 27d5a031ff

View File

@ -23,6 +23,11 @@ QUIET=
[ "$QUIET" ] || echo "Secure boot setup script for openmamba" [ "$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" ] || { [ "$SECUREBOOT_ENABLED" == "00000001" ] || {
[ "$QUIET" ] || echo "Secure Boot is not enabled; exiting." [ "$QUIET" ] || echo "Secure Boot is not enabled; exiting."
exit 0 exit 0