Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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