Created
February 1, 2013 15:44
-
-
Save gchristian/4692090 to your computer and use it in GitHub Desktop.
script to re-enable java and stop xprotect from requiring a minimum version of java
This file contains hidden or 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 | |
#step through users and check for java prefs file, if found enable java web componets | |
USERS=`ls /Users` | |
for f in $USERS | |
do | |
JPREFS=`ls /Users/$f/Library/Preferences/ByHost/com.apple.java.JavaPreferences.*.plist` | |
if [ -e "$FPREFS" ] | |
then | |
/usr/libexec/PlistBuddy -c "Delete :GeneralByTask:Any:WebComponentsEnabled" $JPREFS | |
/usr/libexec/PlistBuddy -c "Add :GeneralByTask:Any:WebComponentsEnabled bool true" $JPREFS | |
fi | |
done | |
#delete block on JavaWebComponents | |
/usr/libexec/PlistBuddy -c "Delete :JavaWebComponentVersionMinimum" /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/XProtect.meta.plist | |
#turn off xprotectupdater downloads (tested on 10.6 and 10.7) to prevent block from just being added back | |
launchctl unload -w /System/Library/LaunchDaemons/com.apple.xprotectupdater.plist | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment