Created
March 27, 2014 13:15
-
-
Save kjvalencik/9807325 to your computer and use it in GitHub Desktop.
Replace the 64-bit java binary with a shell script that will use the 32-bit binary iif Juniper Network Connect is being loaded.
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
#!/bin/bash | |
JAVA=$(readlink -f `which java`) | |
JAVA32=$(echo $JAVA | sed 's/\/jvm\//\/jvm\/ia32-/ig') | |
if [ -a $JAVA.orig ] | |
then | |
echo "Binary already patched" | |
else | |
echo "Patching binary..." | |
mv $JAVA $JAVA.orig | |
#if [ $3x = "NCx" ] | |
#then | |
# /usr/lib/jvm/ia32-java-7-oracle/jre/bin/java "$@" | |
#else | |
# /usr/lib/jvm/java-7-oracle/jre/bin/java.orig "$@" | |
#fi | |
printf "#!/bin/bash\nif [ \$3x = \"NCx\" ]\nthen\n\t$JAVA32 \"\$@\"\nelse\n\t$JAVA.orig \"\$@\"\nfi\n" > $JAVA | |
chmod +x $JAVA | |
echo "Done!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment