#!/bin/sh

. /etc/init.d/functions

# See how we were called.
case "$0" in
  *halt)
        message="Halting system..."
        ;;
  *reboot)
        message="Rebooting system..."
        ;;
  *start)
        message="Starting system..."
        ;;
  *)
        echo "$0: call me as 'rc.halt', 'rc.reboot', or 'rc.start' please!"
        exit 1
        ;;
esac

if [ -n "$1" ]; then
 case "$1" in
   *start)
        ;;
   *)
        echo "Usage: (halt|reboot|start) {start}"
        exit 1
        ;;
 esac
fi

echo -n "Updating summary log: "
#try and match what syslog displays
date=`date +"%b %e %T"`
name=`hostname -s`
time=`date +"%s"`
umask 077
echo  "$date $name vmkhalt: ($time) $message"  >> /var/log/vmksummary
sync; sync; sync
success
echo
