#!/bin/sh

PLT_QUERY_FILE=/usr/sbin/system-is-osa500

if [ -f ${PLT_QUERY_FILE} ]; then

  # it seems os4k-platform-support is installed, so we have a platform version > 7.1.x
  ${PLT_QUERY_FILE}
  rc=$?
  if [ "$rc" = "0" ]; then
    echo "HPA"
    exit 1
  else
    echo "no HPA"
    exit 0
  fi

else
  # it seems os4k-platform-support is not installed, so we have a platform version <=  7.1.7
  # in this case we make the traditional query via dmidecode
  /usr/sbin/dmidecode -s system-version | grep SEN > /dev/null
  if [ "$?" = "0" ]; then
    echo "HPA"
    exit 1
  else
    echo "no HPA"
    exit 0
  fi
fi
  