Skip to content

Instantly share code, notes, and snippets.

@sticklerm3
Created April 14, 2019 08:17
Show Gist options
  • Save sticklerm3/0ae03ba70b02e86f1097cdf6fc3f39f0 to your computer and use it in GitHub Desktop.
Save sticklerm3/0ae03ba70b02e86f1097cdf6fc3f39f0 to your computer and use it in GitHub Desktop.

Revisions

  1. sticklerm3 created this gist Apr 14, 2019.
    18 changes: 18 additions & 0 deletions efi-check
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #!/usr/bin/env bash
    # This script was sourced from http://krypted.com/uncategorized/check-the-efi-version-of-a-mac/

    current_efi_version=$(/usr/libexec/efiupdater | grep "Raw" | cut -d ':' -f2 | sed 's/ //')

    echo "current_efi_version $current_efi_version"

    latest_efi_version=$(ls -La /usr/libexec/firmwarecheckers/eficheck/EFIAllowListShipping.bundle/allowlists/ | grep "$current_efi_version")

    echo "latest_efi_version $latest_efi_version"

    if [ "$latest_efi_version" == "" ]; then
    echo "EFI FAILED"
    exit 1
    else
    echo "EFI PASSED"
    exit 0
    fi