Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
USERNAME=""
PASSWORD=""
URL="https://"
HELP="Usage:\t ilo3_jnlp.sh USERNAME PASSWORD URL"
if [ -z ${1} ]
then
echo -e "${USAGE}"
exit $?
fi
USERNAME="$1"
PASSWORD="$2"
URL=$URL${3}
# need session key, remote port
session_key=$(
curl -fsS \
--insecure \
"$URL/json/login_session" \
--data "{\"method\":\"login\",\"user_login\":\"$USERNAME\",\"password\":\"$PASSWORD\"}" |
sed 's/.*"session_key":"\([a-f0-9]\{32\}\)".*/\1/'
) || {
echo "Error retrieving session key" >&2
exit $1
}
rport=$(
curl -fsS \
--insecure \
"$URL/json/login_session" \
--data "{\"method\":\"login\",\"user_login\":\"$USERNAME\",\"password\":\"$PASSWORD\"}" |
sed 's/.*"rport":"\([a-f0-9]\{32\}\)".*/\1/'
) || {
echo "Error retrieving remote port" >&2
exit $1
}
jnlp=$(mktemp)
cat >"$jnlp" <<eof
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="$URL/" href="">
<information>
<title>Integrated Remote Console</title>
<vendor>HPE</vendor>
<offline-allowed></offline-allowed>
</information>
<security>
<all-permissions></all-permissions>
</security>
<resources>
<j2se version="1.5+" href="http://java.sun.com/products/autodl/j2se"></j2se>
<jar href="$URL/html/intgapp3_231.jar" main="false" />
</resources>
<property name="deployment.trace.level property" value="basic"></property>
<applet-desc main-class="com.hp.ilo2.intgapp.intgapp" name="iLOJIRC" documentbase="$URL/html/java_irc.html" width="1" height="1">
<param name="RCINFO0" value="MHgxDWZjYzYwNDAyM2UxNDZhYzI0YTdiN2M2ZGM3MzE0ZDQ3"/>
<param name="RCINFO1" value="$session_key"/>
<param name="RCINFO3E" value="1"/>
<param name="RCINFO6" value="$rport"/>
<param name="RCINFO7" value="35791394"/>
<param name="RCINFO8" value="1"/>
<param name="RCINFOA" value="1"/>
<param name="RCINFOB" value="A4E3F9D86FE5B1D076780BEEBC3FE09B"/>
<param name="RCINFOC" value="F29E12581A79FD660C565004EA8FD2BD"/>
<param name="RCINFOD" value="102603"/>
<param name="RCINFOM" value="1"/>
<param name="RCINFOMM" value="1"/>
<param name="RCINFON" value="0"/>
<param name="RCINFOO" value="3389"/>
<param name="RCINFOLANG" value="en"/>
<param name="INFO0" value="7AC3BDEBC9AC64E85734454B53BB73CE"/>
<param name="INFO1" value="17988"/>
<param name="INFO2" value="composite"/>
<param name="INFO3" value="linux-mt4s"/>
<param name="INTGTITLE" value="Integrated Remote Console"/>
</applet-desc>
<update check="background"></update>
</jnlp>
eof
javaws.itweb -jnlp $jnlp; rm $jnlp
@cpasternack
Copy link
Author

cpasternack commented Apr 11, 2020

Required more parameters from original gist and intgapp228 to start jar, in line with https://ilo.machine.domain/html/java_irc.html output from curl. This was from the netscape and not IE document.writeln(...) parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment