#!/bin/sh
#SYSTEMS: Solaris
MSG="# Checking permission setting in /etc/default/sys-suspend..."
SYSTEM=`uname -s`
######Solaris######
if [ "$SYSTEM" = "SunOS" ]; then
  echo ""; echo "$MSG"
  SYSSUSPEND=/etc/default/sys-suspend
  case "`uname -r`" in
    5.[6789]*) ;;
    *)
      #Only supported on Solaris 2.6 and newer
      exit 0;;
  esac
  if [ -f ${SYSSUSPEND} ]; then
    perms=`grep '^PERMS' ${SYSSUSPEND} | awk -F= '{ print $2 }'`
    # Determine the values in place.  If not '-' then report failure
    if [ "-" != "${perms}" ]; then
      if [ -z "${perms}" ]; then 
        perms="NONE"
      fi
      echo "--WARN-- [SUSPEND001w] The variable 'PERMS' in ${SYSSUSPEND} is '${perms}'."
    fi
  fi
fi
