#!/bin/bash


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 off
    echo
fi

if [ $IPMI_PASSWORD ]; then
    /usr/bin/ipmitool -E -I lanplus -H $1 -U root chassis power off
fi

exit 0
