#!/bin/sh -e

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

usage()
{
    printf "Usage: $0\n"
    exit 64     # sysexits(3) EX_USAGE
}


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

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

case `auto-ostype` in
FreeBSD)
    pkg install -y ipmitool
    chmod 750 /usr/local/bin/ipmitool
    auto-append-line 'ipmi_load="YES"' /boot/loader.conf $0
    kldload ipmi
    ;;

RHEL)
    yum install -y OpenIPMI ipmitool
    chkconfig ipmi on
    service ipmi start
    chmod 750 /usr/bin/ipmitool
    ;;

*)
    auto-unsupported-os $0
    exit 1
    ;;

esac
