Fix: check_secure_boot function mokutil issue, returns 1 insted of exit 1. Causes secure-boot to be true, even though it can't verify it. Also added mokutil to required commands.

This commit is contained in:
Sumeet Dube
2024-09-22 16:38:35 +05:30
parent ec0e484202
commit da5fa081a5

View File

@@ -83,7 +83,7 @@ check_required_packages() {
DISTRO_VERSION="$DISTRO $VERSION"
# Example required commands, now including "xrandr" and "bc"
REQUIRED_COMMANDS=("curl" "lsb_release" "glxinfo" "pkexec" "wget" "xdg-open" "ls" "cat" "echo" "awk" "7z" "cabextract" "samba" "wbinfo" "systemctl" "bc" "xrandr")
REQUIRED_COMMANDS=("curl" "lsb_release" "glxinfo" "pkexec" "wget" "xdg-open" "ls" "cat" "echo" "awk" "7z" "cabextract" "samba" "wbinfo" "systemctl" "bc" "xrandr" "mokutil")
# Array to store missing commands
MISSING_COMMANDS=()
@@ -141,6 +141,15 @@ check_required_packages() {
echo -e "${GREEN}The required command (${cmd}) is available!${NOCOLOR}"
fi
;;
mokutil)
if ! mokutil &>/dev/null; then
echo -e "${RED}The required command (${cmd}) is not available!${NOCOLOR}"
MISSING_COMMANDS+=("$cmd")
else
echo -e "${GREEN}The required command (${cmd}) is available!${NOCOLOR}"
fi
;;
*)
echo -e "${GREEN}The required command (${cmd}) is available!${NOCOLOR}"
;;
@@ -414,8 +423,8 @@ function create_data_structure() {
# Function to check if Secure Boot is activated
function check_secure_boot {
if ! command -v mokutil &> /dev/null; then
echo "mokutil command not found. Please install it to check Secure Boot status."
return 1
echo "${RED} mokutil command not found. Please install it to check Secure Boot status."
exit 1
fi
# Check if Secure Boot is enabled