mirror of
https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux.git
synced 2025-11-03 20:06:09 +01:00
Update check-secure-boot-status.sh
This commit is contained in:
@@ -1,27 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Function to check if Secure Boot is activated
|
||||||
check_secure_boot() {
|
check_secure_boot() {
|
||||||
# Check if the system supports Secure Boot
|
if ! command -v mokutil &> /dev/null; then
|
||||||
if [ ! -d "/sys/firmware/efi" ]; then
|
echo "mokutil command not found. Please install it to check Secure Boot status."
|
||||||
echo "EFI firmware is not detected. Secure Boot is not supported."
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if the SecureBoot variable exists
|
# Check if Secure Boot is enabled
|
||||||
if [ -f "/sys/firmware/efi/efivars/SecureBoot-*" ]; then
|
if mokutil --sb-state | grep -q 'Secure Boot enabled'; 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."
|
echo "Secure Boot is enabled."
|
||||||
return 0
|
|
||||||
else
|
else
|
||||||
echo "Secure Boot is disabled."
|
echo "Secure Boot is not enabled."
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "Secure Boot variable not found. Secure Boot may not be supported."
|
|
||||||
return 1
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Call the function to check Secure Boot status
|
# Call the function
|
||||||
check_secure_boot
|
check_secure_boot
|
||||||
|
|||||||
Reference in New Issue
Block a user