Skip to content

Instantly share code, notes, and snippets.

@bearice
Created August 7, 2017 06:10
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bearice/2cb343b258d3826ef46e821c7b8f3f66 to your computer and use it in GitHub Desktop.
Save bearice/2cb343b258d3826ef46e821c7b8f3f66 to your computer and use it in GitHub Desktop.
run Dell idrac Remote console from shell (POC)
#/bin/bash
HOST=$1
USER=root
PASS=calvin
RET=$(curl -s https://$HOST/data/login -duser=$USER -dpassword=$PASS -c .cookie -b .cookie -k)
ST1=$(echo "$RET" | awk 'match($0, /ST1=[0-9a-f]+/){ print substr( $0, RSTART, RLENGTH )}')
echo $ST1
PARAM="$HOST@0@$HOST@0@$ST1"
curl -s "https://$HOST/viewer.jnlp($PARAM)" -c .cookie -b .cookie -k > start.jnlp
javaws start.jnlp
rm .cookie start.jnlp
@scriptkiddy
Copy link

scriptkiddy commented Jan 14, 2020

Hi,

awesome script! I need to open the same bunch of old idrac consoles every now and then and idrac being idrac that was a pain!

A small note though:
You leave your idrac web session open. That will clog your idrac eventually and it will become none responsive for a while because it reached it's maximum number of open sessions.

I'de recommend adding the following line after line 9:
RET=$(curl -s https://${HOST}/data/logout -c .cookie -b .cookie -k)

cheers

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