diff options
Diffstat (limited to 'rc.d/init.d')
-rwxr-xr-x | rc.d/init.d/halt | 46 |
1 files changed, 44 insertions, 2 deletions
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` |