#!/bin/bash
# Usage of this utility
function usage() {
    echo "usage: power-util mb [on|off|status|cycle|reset]";
    echo "       power-util sled-cycle"
}

power_off() {
    echo "Shutting down Server"
    busctl set-property xyz.openbmc_project.State.Chassis /xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis RequestedPowerTransition s xyz.openbmc_project.State.Chassis.Transition.Off
}

power_on() {
    echo "Powering on Server"
    busctl set-property xyz.openbmc_project.State.Chassis /xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis RequestedPowerTransition s xyz.openbmc_project.State.Chassis.Transition.On
}

power_status() {
    st=$(busctl get-property xyz.openbmc_project.State.Chassis /xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis CurrentPowerState | cut -d"." -f6)
    if [ "$st" == "On\"" ]; then
        echo "on"
    else
        echo "off"
    fi
}

power_reset() {
    echo "Reset on server"
    busctl set-property xyz.openbmc_project.State.Chassis /xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis RequestedPowerTransition s xyz.openbmc_project.State.Chassis.Transition.Reset
}

sled_cycle() {
    i2cset -y 7 0x45 0xd9 c
}

if [ "$1" == "sled-cycle" ]; then
    echo "SLED_CYCLE starting at $(date)"
    sled_cycle
    exit 0;
fi

if [ $# -lt 2 ]; then
    echo "Total number of parameter=$#"
    echo "Insufficient parameter"
    usage;
    exit 0;
fi

if [ "$1" != "mb" ]; then
    echo "Invalid parameter1=$1"
    usage;
    exit 0;
fi

if [ "$2" = "on" ]; then
  if [ "$(power_status)" == "off" ]; then
      power_on
  fi
elif [ "$2" = "off" ]; then
  if [ "$(power_status)" == "on" ]; then
      power_off
  fi
elif [ "$2" == "cycle" ]; then
  if [ "$(power_status)" == "on" ]; then
      power_off
  else
    echo "WARNING: Powering on server"
  fi
    power_on
elif [ "$2" == "reset" ]; then
  if [ "$(power_status)" == "on" ]; then
      power_reset
  else
    echo "ERROR: Server not powered on"
  fi
elif [ "$2" == "status" ]; then
    power_status
else
    echo "Invalid parameter2=$2"
    usage;
fi

exit 0;
