Skip to content

Instantly share code, notes, and snippets.

@sgmills
Last active July 27, 2022 12:25
Show Gist options
  • Save sgmills/7c6970b697235ee14b3ef0a871547604 to your computer and use it in GitHub Desktop.
Save sgmills/7c6970b697235ee14b3ef0a871547604 to your computer and use it in GitHub Desktop.
#!/bin/sh
# If cpu is Apple branded, use arch binary to check if x86_64 code can run
if [[ "$(sysctl -n machdep.cpu.brand_string)" == *'Apple'* ]]; then
if arch -x86_64 /usr/bin/true 2> /dev/null; then
result="Installed"
else
result="Missing"
fi
else
result="Ineligible"
fi
echo "<result>$result</result>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment