#!/bin/bash

# $Id$

if [ ! $IPMI_PASSWORD ]; then
    stty -echo
    read -p "Password: " passw; echo
    stty echo
echo

/usr/bin/ipmitool -I lanplus -H $1 -U root -P $passw chassis power status
echo
fi

if [ $IPMI_PASSWORD ]; then
    igot=`/usr/bin/ipmitool -E -I lanplus -H $1 -U root chassis power status`
    echo "$1 $igot"
fi

exit 0
