#!/sbin/sh
#
# setclock	This script sets the system clock.
#
# Version:	@(#) /sbin/init.d/setclock  1.50 1994-01-18
#
# Author:	Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
#

  # See how we were called.
  case "$1" in
    bcheckrc)
	echo "Bcheckrc: Setting local date from CMOS..."
	if [ ! -f /etc/adjtime ]
	then
		echo "0.0 0 0.0" > /etc/adjtime
		chown bin.daemon /etc/adjtime
		chmod 644 /etc/adjtime
	fi
	# Note : Openwindow have also a clock!
	if [ -x /sbin/clock ]; then
	   /sbin/clock -au
	fi
        ;;
    *)
        # Oops someone made a typo.
        echo "Usage: /sbin/init.d/setclock {bcheckrc}"
        exit 1
  esac

exit 0
