#!/bin/sh
#SYSTEMS: Solaris
MSG="# Checking for the DHCP server service..."
SYSTEM=`uname -s`
######Solaris######
if [ "$SYSTEM" = "SunOS" ]; then
  echo ""; echo "$MSG"
  case "`uname -r`" in
  5.[89]*) ;;
  *)
    #Only supported on Solaris 8 and newer"
    exit 0;;
  esac
  PS=`ps -ef | grep in.dhcpd | grep -v grep`
  if [ "$PS" != "" ]; then  #A DHCP server is running!
    echo "--FAIL-- [DHCP002f] A DHCP server is running on this system."
  else
    CHK=`ls /etc/rc*.d/S*dhcp 2>/dev/null | tr "[\n]" " "`
    if [ "$CHK" != "" ]; then  # The DHCP startup script exists..
      echo "--WARN-- [DHCP001i] A DHCP server script was FOUND in a /etc/rc*.d directory."
    fi
  fi
fi