mirror of
https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux.git
synced 2025-11-01 19:06:08 +01:00
Create check-secure-boot-status.sh
This commit is contained in:
27
files/testing-scripts/check-secure-boot-status.sh
Normal file
27
files/testing-scripts/check-secure-boot-status.sh
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
check_secure_boot() {
|
||||||
|
# Check if the system supports Secure Boot
|
||||||
|
if [ ! -d "/sys/firmware/efi" ]; then
|
||||||
|
echo "EFI firmware is not detected. Secure Boot is not supported."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if the SecureBoot variable exists
|
||||||
|
if [ -f "/sys/firmware/efi/efivars/SecureBoot-*" ]; then
|
||||||
|
secure_boot_status=$(hexdump -v -e '/1 "%d"' /sys/firmware/efi/efivars/SecureBoot-*)
|
||||||
|
if [ "$secure_boot_status" -eq 1 ]; then
|
||||||
|
echo "Secure Boot is enabled."
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo "Secure Boot is disabled."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Secure Boot variable not found. Secure Boot may not be supported."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Call the function to check Secure Boot status
|
||||||
|
check_secure_boot
|
||||||
Reference in New Issue
Block a user