Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
servers=('http://rosmacdb01.dax.local/'
'http://myurl/'
'http://myurl/'
'http://myurl'
'http://myurl/'
'http://myurl/'
'http://myurl/'
'http://myurl/')
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
You can’t perform that action at this time.