Skip to content

Instantly share code, notes, and snippets.

@joshua-d-miller
Created January 20, 2014 17:04
Show Gist options
  • Save joshua-d-miller/8524097 to your computer and use it in GitHub Desktop.
Save joshua-d-miller/8524097 to your computer and use it in GitHub Desktop.
Java 7 Update 51 Exception.sites script to allow all users to modify the file as well as add your own on the administrative side. Use as postinstall_script.
#!/bin/sh
# Java script to add the exception.sites in a shared location for the
# new version of Java. Script created and updated by Josh Miller and
# Matt Hansen. Last update January 20, 2014.
# This command will check to see if the Java Deployment directory
# exists. If not, it will create it for you.
test -d /Library/Application\ Support/Oracle/Java/Deployment || mkdir -p /Library/Application\ Support/Oracle/Java/Deployment
# This set of commands will check to see if the deployment.properties
# file exists. If not it will create the file and then check for specific
# properties in the file.
test -e /Library/Application\ Support/Oracle/Java/Deployment/deployment.properties || touch /Library/Application\ Support/Oracle/Java/Deployment/deployment.properties
grep -qi deployment.macosx.check.update=false "/Library/Application Support/Oracle/Java/Deployment/deployment.properties" || echo 'deployment.macosx.check.update=false' >> /Library/Application\ Support/Oracle/Java/Deployment/deployment.properties
grep -qi deployment.user.security.exception.sites=/Users/Shared/Java/exception.sites "/Library/Application Support/Oracle/Java/Deployment/deployment.properties" || echo 'deployment.user.security.exception.sites=/Users/Shared/Java/exception.sites' >> /Library/Application\ Support/Oracle/Java/Deployment/deployment.properties
# These commands will check to see if the exception.sites file exists and
# if the sites we need are in the exception.sites. If the sites do not
# exist they will be outputeed to the file.
test -d /Users/Shared/Java/ || mkdir -p /Users/Shared/Java
test -e /Users/Shared/Java/exception.sites || touch /Users/Shared/Java/exception.sites
grep -qi https://cclibrary.skillport.com "/Users/Shared/Java/exception.sites" || echo 'https://cclibrary.skillport.com' >> /Users/Shared/Java/exception.sites
# Applies correct permissions to the exception.sites file located
# in /Users/Shared/Java/ so all users can modify the file and thus
# add sites to the exceptions list if needed.
chmod -R +a "everyone allow delete,chown,list,search,add_file,add_subdirectory,delete_child,file_inherit,directory_inherit" /Users/Shared/Java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment