#!/bin/sh
#
# SYSTEMS: Solaris
# This script checks the RETRIES variable in /etc/default/login
# to see if it is set, or if set, has a value of '3' or less.
#
MSG="# Checking the number of login retries allowed..."
SYSTEM=`uname -s`
######Solaris######
if [ "$SYSTEM" = "SunOS" ]; then
  echo ""; echo "$MSG"
  LOGIN=/etc/default/login
  if [ ! -f ${LOGIN} ]; then
    # ${LOGIN} does not exist."
    exit 0
  fi
  VALUE=`grep "RETRIES=" ${LOGIN} | grep -v "^#" | awk -F\= '{ print $2 }'`
  if [ "${VALUE}" = "" ]; then
    echo "--INFO-- [LOGIN002i] '${LOGIN}' RETRIES value not set."
  else
    if [ "${VALUE}" -gt "3" ]; then
      echo "--INFO-- [LOGIN002i] RETRIES value in ${LOGIN} is ${VALUE}.  Should be '3' or less."
    fi
  fi
fi