Skip to content

Instantly share code, notes, and snippets.

@jacobsalmela
Last active August 29, 2015 14:08
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 jacobsalmela/b4e9077b2e86723c7553 to your computer and use it in GitHub Desktop.
Save jacobsalmela/b4e9077b2e86723c7553 to your computer and use it in GitHub Desktop.
Adds Pearsons TestNav to the Java Exception list
#!/bin/sh
# This script will x amount of servers to the Oracle Java Exception Site List.
# By Jacob Salmela
# Based on: http://derflounder.wordpress.com/2014/01/16/managing-oracles-java-exception-site-list/
# List of each server to be added to the Java whitelist (one per line in single quotes)
servers=('http://www.pearsonaccess.com/cs/Satellite?pagename=Pearson/QuickLink/mn'
'https://www.testnav.com/'
'https://proctorcaching.pearsonaccess.com/ems/systemCheck/systemCheck.jsp?acc=mn'
'https://testnav.com/mn/testnav-7.5.22.36/'
'http://testnav.com/mn/testnav-7.5.22.36/selfRegistration.htm'
'http://testnav.com/mntrng/'
'http://selfregister.testnav.com/'
'https://testnav.com/'
'https://pearsonmylabandmastering.com/')
whitelist=$HOME"/Library/Application Support/Oracle/Java/Deployment/security/exception.sites"
javaPlugin=$(defaults read "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Info" CFBundleIdentifier)
mkdir -p $HOME"/Library/Application Support/Oracle/Java/Deployment/security/"
if [[ ${javaPlugin} != 'com.oracle.java.JavaAppletPlugin' ]]; then
echo "Oracle Java browser plug-in not installed"
exit 1
else
echo "Oracle Java browser plug-in IS installed."
if [[ ! -f "$whitelist" ]]; then
echo "Oracle Java Exception Site List not found. Creating one..."
touch "$whitelist"
for i in "${servers[@]}"
do
echo "Adding exception for: $i..."
echo $i >> "$whitelist"
done
else
for i in "${servers[@]}"
do
whitelistCheck=$(cat $HOME"/Library/Application Support/Oracle/Java/Deployment/security/exception.sites" | grep $i)
if [[ -n ${whitelistCheck} ]];then
echo "Exception already exists..."
else
echo "Adding exception for: $i..."
echo "$i" >> "$whitelist"
fi
done
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment