cat > /etc/init.d/setclock << "EOF"
#!/bin/sh
# Begin /etc/init.d/setclock

#
# Include the functions declared in the /etc/init.d/functions file
# and include the variables from the /etc/sysconfig/clock file
#

source /etc/init.d/functions
source /etc/sysconfig/clock

#
# Right now we want to set the kernel clock according to the hardware
# clock, so we use the -hctosys parameter.
#

CLOCKPARAMS="--hctosys"

#
# If the UTC variable is set in the /etc/sysconfig/clock file, add the
# -u parameter as well which tells hwclock that the hardware clock is
# set to UTC time instead of local time.
#

case "$UTC" in
        yes|true|1)
                CLOCKPARAMS="$CLOCKPARAMS --utc"
                ;;
        no|false|0)
                CLOCKPARAMS="$CLOCKPARAMS --localtime"
                ;;
esac

echo -n "Setting clock..."
/sbin/hwclock $CLOCKPARAMS
evaluate_retval

# End /etc/init.d/setclock
EOF

cat > /etc/sysconfig/clock << "EOF"
# Begin /etc/sysconfig/clock

UTC=0

# End /etc/sysconfig/clock
EOF
