From 906115db10d72592fecab5fb2a35e684cb39055a Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 23 Jan 2001 21:24:50 +0000 Subject: read /etc/sysconfig/clock on syncing hwclock --- rc.d/init.d/halt | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) (limited to 'rc.d/init.d') diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt index 96cf2a46..347c596b 100755 --- a/rc.d/init.d/halt +++ b/rc.d/init.d/halt @@ -56,8 +56,50 @@ if [ $? = 0 -a -x /bin/aumix-minimal ]; then runcmd $"Saving mixer settings" /bin/aumix-minimal -f /etc/.aumixrc -S fi -# Sync clock -runcmd $"Syncing hardware clock to system time" /sbin/hwclock --systohc +# Sync the system clock. +ARC=0 +SRM=0 +UTC=0 + +if [ -f /etc/sysconfig/clock ]; then + . /etc/sysconfig/clock + + # convert old style clock config to new values + if [ "${CLOCKMODE}" = "GMT" ]; then + UTC=true + elif [ "${CLOCKMODE}" = "ARC" ]; then + ARC=true + fi +fi + +CLOCKDEF="" +CLOCKFLAGS="--systohc" + +case "$UTC" in + yes|true) + CLOCKFLAGS="$CLOCKFLAGS -u"; + CLOCKDEF="$CLOCKDEF (utc)"; + ;; + no|false) + CLOCKFLAGS="$CLOCKFLAGS --localtime"; + CLOCKDEF="$CLOCKDEF (localtime)"; + ;; +esac + +case "$ARC" in + yes|true) + CLOCKFLAGS="$CLOCKFLAGS -A"; + CLOCKDEF="$CLOCKDEF (arc)"; + ;; +esac +case "$SRM" in + yes|true) + CLOCKFLAGS="$CLOCKFLAGS -S"; + CLOCKDEF="$CLOCKDEF (srm)"; + ;; +esac + +runcmd $"Syncing hardware clock to system time" /sbin/hwclock $CLOCKFLAGS # Turn off swap, then unmount file systems. SWAPS=`awk '! /^Filename/ { print $1 }' /proc/swaps` -- cgit v1.2.1