Skip to content

Commit

Permalink
Split up checking to check for sb enabled first
Browse files Browse the repository at this point in the history
  • Loading branch information
jardon committed Sep 13, 2024
1 parent 1cc6160 commit 880d75d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion system_files/shared/usr/libexec/sb-key-notify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ WARNING_MSG="This machine has secure boot turned on, but you haven't enrolled Un
KEY_WARN_FILE="/run/user-motd-sbkey-warn.md"
KEY_DER_FILE="/etc/pki/akmods/certs/akmods-ublue.der"

if mokutil --test-key "$KEY_DER_FILE" && mokutil --sb-state | grep -q enabled; then
mokutil --sb-state | grep -q enabled
SB_ENABLED=$?

if [ $SB_ENABLED -ne 0 ]; then
echo "Secure Boot disabled. Skipping..."
exit 0
fi

if mokutil --test-key "$KEY_DER_FILE"; then
if loginctl --help | grep -q "json=MODE"; then
JSON_ARG="--json=short"
fi
Expand Down

0 comments on commit 880d75d

Please sign in to comment.