From da5fa081a5a587460320d6f59aa56abcf346620e Mon Sep 17 00:00:00 2001 From: Sumeet Dube Date: Sun, 22 Sep 2024 16:38:35 +0530 Subject: [PATCH] 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. --- files/setup/autodesk_fusion_installer_x86-64.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/files/setup/autodesk_fusion_installer_x86-64.sh b/files/setup/autodesk_fusion_installer_x86-64.sh index 7e861e2..c34b8e0 100755 --- a/files/setup/autodesk_fusion_installer_x86-64.sh +++ b/files/setup/autodesk_fusion_installer_x86-64.sh @@ -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