Skip to content

Instantly share code, notes, and snippets.

@rtrouton
Last active December 18, 2015 20:58
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 rtrouton/5843570 to your computer and use it in GitHub Desktop.
Save rtrouton/5843570 to your computer and use it in GitHub Desktop.
This Casper Extension Attribute determines if either of the the following Java builds are installed: 10.6.x: 1.6.0_51-b11-456-10M4508 10.7.x - 10.8.x: 1.6.0_51-b11-456-11M4508 These builds were installed by the first versions of Java for OS X 2013-004 and Java for Mac OS X 10.6 Update 16 and can cause problems for Java Swing applications like MA…
#!/bin/sh
# Determines if either of the following
# Java builds are installed:
#
# 10.6.x: 1.6.0_51-b11-456-10M4508
# 10.7.x - 10.8.x: 1.6.0_51-b11-456-11M4508
#
# This builds were installed by the first versions of
# Java for OS X 2013-004 and Java for Mac OS X 10.6 Update 16
# and can cause problems for Java Swing applications
# like MATLAB and Papercut.
JAVA_BUILD_CHECK=`java -version 2>&1 | awk '/4508/{print $NF}' | sed '$s/.$//'`
FOUND=`echo "Installed"`
NOT_FOUND=`echo "Not Found"`
if [ "$JAVA_BUILD_CHECK" = "1.6.0_51-b11-456-10M4508" ]; then
result=$FOUND
elif [ "$JAVA_BUILD_CHECK" = "1.6.0_51-b11-456-11M4508" ]; then
result=$FOUND
elif [ "$JAVA_BUILD_CHECK" = "" ]; then
result=$NOT_FOUND
fi
# If either 1.6.0_51-b11-456-10M4508 or 1.6.0_51-b11-456-11M4508
# is installed, an "Installed" message is displayed.
#
# If neither 1.6.0_51-b11-456-10M4508 or 1.6.0_51-b11-456-11M4508
# is installed, a "Not Found" message is displayed.
echo "<result>$result</result>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment