#!/bin/bash

# Set the path.
PATH=/sbin:/bin:/usr/bin:/usr/sbin

. /etc/init.d/functions

runcmd() {
   echo -n "$1 "
   shift
   if [ "$BOOTUP" = "color" ]; then
      $* && echo_success || echo_failure
   else
      $*
   fi
   echo
}

# See how we were called.
case "$0" in
  *halt)
	message="The system is halted"
	command="halt"
	;;
  *reboot)
	message="Please stand by while rebooting the system..."
	command="reboot"
	;;
  *)
	echo "$0: call me as \"rc.halt\" or \"rc.reboot\" please!"
	exit 1
	;;
esac

runcmd "Syncing hardware clock to system time..." /sbin/hwclock --systohc --utc

eval $command -i -d -p 

