Last active
August 29, 2015 14:24
-
-
Save dderusha/bd06694dbec35470e2db to your computer and use it in GitHub Desktop.
Java JDK Extension Attribute
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###Test Code### | |
### Intention is to figure out what JDK the user has installed. | |
### our current Ext atty reports the JRE, we need to know they have the JDK | |
## thanks to elliotjordon | |
## -00 is just a number to say that JDK is not installed. makes for better smartgroup searches | |
############### | |
if JDKver=$(ls "/Library/Java/JavaVirtualMachines" | awk -F "_|.jdk" '/.jdk/{print $2}' | tail -1) | |
then | |
echo "<result>$JDKver</result>" | |
else | |
echo "<result>-00</result>" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment