Skip to content

Instantly share code, notes, and snippets.

@eniac111
Created January 6, 2014 23:39
Show Gist options
  • Save eniac111/8292068 to your computer and use it in GitHub Desktop.
Save eniac111/8292068 to your computer and use it in GitHub Desktop.
The script fixes the annoying "no iKVM64 in java.library.path" bug with the Java iKVM laucher of some Supermicro servers :)
#!/bin/bash
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# <[email protected]> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return Blagovest Petrov
# ----------------------------------------------------------------------------
# The script fixes the "no iKVM64 in java.library.path" bug with the SuperMicro
# iKVM Java S**t. You can do an alias of it, like: "alias javaws=/usr/local/bin/launchikvm"
if [ -f $1 ]; then
Arch86Line=$(cat $1 | grep -n '<resources os="Linux" arch="x86_64">'|grep -o '^[0-9]*')
Arch86Line=`expr $Arch86Line + 1`
sed -i $Arch86Line'i\ <property name="jnlp.packEnabled" value="true"/>\n <property name="jnlp.versionEnabled" value="true"/>' `echo $1`
ArchAmdLine=$(cat $1 | grep -n '<resources os="Linux" arch="amd64">'|grep -o '^[0-9]*')
ArchAmdLine=`expr $ArchAmdLine + 1`
sed -i $ArchAmdLine'i\ <property name="jnlp.packEnabled" value="true"/>\n <property name="jnlp.versionEnabled" value="true"/>' `echo $1`
javaws $1
else
echo "File $1 doesn't exist or is not a file!" >&2
echo "Usage: $0 [filename] (launch.jnlp)" >&2
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment