ciphermethod.com

20100421: changeilom.sh

by on Apr.21, 2010, under Linux, Scripts

#!/bin/sh
# 20100421 – Jamey Hopkins

echo
echo “Change root password on Sun ILOM cards”
echo

if [ “$1” = “” ]
then
echo need server list
echo example: changeilom.sh servers.txt
exit
fi

if [ ! -f $1 ]
then
echo “Server list $1 not found.”
echo
exit
fi

echo “Enter new password”
echo -n “Password: ”
stty -echo
read PASS1
stty echo
echo
echo “Enter password again”
echo -n “Password: ”
stty -echo
read PASS2
stty echo

echo

if [ “$PASS1” != “$PASS2” ]
then
echo passwords did not match
exit
fi

LIST=$1

echo “user set password 2 $PASS1” >cmnds.ilom
echo “quit” >>cmnds.ilom

for x in `cat $LIST`
do

echo $x
#ssh ${x}.fls ls
scp ./cmnds.ilom ${x}.fls: >/dev/null
echo “Running IPMITOOL”
ssh ${x}.fls “cat cmnds.ilom | sudo ipmitool shell” >/dev/null
ssh ${x}.fls rm cmnds.ilom
done

rm cmnds.ilom

No comments for this entry yet...

Leave a Reply

You must be logged in to post a comment.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

But Wait, There's More!

A few highly recommended friends...