Last active
March 15, 2021 09:13
-
-
Save justrhysism/e012efccd42320ab62751c063e4fea69 to your computer and use it in GitHub Desktop.
macOS Random Shutdown Script Hack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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