Skip to content

Instantly share code, notes, and snippets.

@justrhysism
Last active March 15, 2021 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justrhysism/e012efccd42320ab62751c063e4fea69 to your computer and use it in GitHub Desktop.
Save justrhysism/e012efccd42320ab62751c063e4fea69 to your computer and use it in GitHub Desktop.
macOS Random Shutdown Script Hack
#!/bin/bash
echo "MacBook Random Shutdown Fix"
# Check version
macOSMajorVersion=$(sw_vers -productVersion | cut -d. -f1)
macOSMinorVersion=$(sw_vers -productVersion | cut -d. -f2)
# Script currently only supports High Sierra and later
if [ "$macOSMajorVersion" != 10 ] || [ "$macOSMinorVersion" -lt 14 ]; then
echo "This script only supports macOS > 10.14";
exit 1;
fi
echo "Removing AppleThunderboltNHI.kext"
rm -rf /Volumes/Macintosh\ HD/System/Library/Extensions/AppleThunderboltNHI.kext
echo "Rebooting"
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment