Created
January 23, 2020 15:23
-
-
Save me-vlad/c50cef0078e6bfcab3dd81203e823176 to your computer and use it in GitHub Desktop.
Open MegaRAC IPMI Java IPKVM from CLI
This file contains hidden or 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/sh | |
# Script opens Java based IPKVM session on the old AMI MegaRAC IPMI. | |
# You need javaws (part of the Java JRE) installed. | |
if [ $# -ne 3 ]; then | |
echo -e "\n\tUsage:\n\t${0##*/} IPMI_HOST USER PASSWORD\n" && exit 1 | |
fi | |
HOST="$1" | |
USER="$2" | |
PASS="$3" | |
JNLP="${PWD}/${HOST}_jviewer.jnlp" | |
COOKIE=$(curl -s -d "WEBVAR_USERNAME=${USER}&WEBVAR_PASSWORD=${PASS}" "http://${HOST}/rpc/WEBSES/create.asp" 2> /dev/null | grep "SESSION_COOKIE" | cut -d "'" -f 4) | |
curl -s -b Cookie=SessionCookie="${COOKIE}" http://$HOST/Java/jviewer.jnlp -o "$JNLP" | |
nohup javaws -Xnosplash "$JNLP" > /dev/null 2>&1 && sleep 1 && rm "$JNLP" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment