#!/bin/sh -e

##########################################################################
#   Title:
#       Optional, defaults to the name of the script sans extention
#
#   Section:
#       8
#
#   Synopsis:
#       
#   Description:
#       Check remote server status using IPMI
#       
#   Arguments:
#       
#   Returns:
#
#   Examples:
#
#   Files:
#
#   Environment:
#
#   See also:
#       
#   History:
#   Date        Name        Modification
#   2020-02-02  Jason Bacon Begin
#   2024-11-12  Jason Bacon Add man page template and usage
##########################################################################

usage()
{
    printf "Usage: $0 host-bmc-address\n"
    exit 1
}


##########################################################################
#   Main
##########################################################################

if [ $# != 1 ]; then
    usage
fi

case $(auto-ostype) in
FreeBSD)
    auto-group-check operator $0
    ;;
esac

if [ -r /root/.ipmipw ]; then
    pw_flags="-f /root/.ipmipw"
fi

# FIXME: Don't hard-code lanplus
# ipmitool -v -I lanplus -H $1 -U root sel list
ipmitool -v -I lanplus -H $1 -U root $pw_flags chassis status
