#!/bin/sh
# udev helper for hwclock
#
# This is based on the hwclock.sh init script, but somewhat simplified.

[ ! -x /sbin/hwclock ] && exit 0
. /etc/default/rcS

[ "$GMT" = "-u" ] && UTC="yes"
case "$UTC" in
    no|"")	GMT="--localtime"
		UTC=""
		;;
    yes)	GMT="--utc"
		UTC="--utc"
		;;
    *)		exit 1 ;;
esac

case "$BADYEAR" in
    no|"")	BADYEAR="" ;;
    yes)	BADYEAR="--badyear" ;;
    *)		exit 1 ;;
esac

# Copies Hardware Clock time to System Clock using the correct
# timezone for hardware clocks in local time, and sets kernel
# timezone. DO NOT REMOVE.
/sbin/hwclock --hctosys $GMT $HWCLOCKPARS $BADYEAR
