#!/bin/sh

# For Redhat-ish systems
# chkconfig: 345 16 82
#
# description: spin boot init file to send a SpinServer Start Message to syslog
# 
# Copyright 2003. Spinnaker Networks Inc.
# All rights reserved.

cd /core
case "$1" in
  start)
      # Send message after reboot, if a crash occurred or user opted for.
      if [ ! -f /etc/normalShutdown ]
      then
	  logger -p daemon.crit -t SpinBoot -- "SpinServer Started After Crash"
      elif [ ! -f /etc/doNotSendMessageAfterReboot ] 
      then
	    logger -p daemon.crit -t SpinBoot -- "SpinServer Started: `cat /etc/normalShutdown`"
      fi

      # Make sure normalShutdown file is deleted after reboot.
      if [ -f /etc/normalShutdown ]
      then
	  rm -f /etc/normalShutdown
      fi
	;;
  *)
        ;;

esac

exit 0
