Skip to content

Instantly share code, notes, and snippets.

@YogSottot
Forked from eniac111/launchikvm
Created July 13, 2024 07:40
Show Gist options
  • Select an option

  • Save YogSottot/2ac643140eb5158af74e070ea7a19ca0 to your computer and use it in GitHub Desktop.

Select an option

Save YogSottot/2ac643140eb5158af74e070ea7a19ca0 to your computer and use it in GitHub Desktop.

Revisions

  1. @eniac111 eniac111 created this gist Jan 6, 2014.
    26 changes: 26 additions & 0 deletions launchikvm
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    #!/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