fs

morpheus filesystem files
git clone git://git.2f30.org/fs
Log | Files | Refs

commit c6cf48aef8f896a8997ef8b5314debf9dddf65e9
parent 5e1cccfb9606f9a6604b996b260466e981e96c07
Author: sin <sin@2f30.org>
Date:   Mon, 17 Feb 2014 12:36:27 +0000

Save the system clock properly in rc.shutdown

Diffstat:
Mbin/rc.init | 4++--
Mbin/rc.shutdown | 22+++++++++++++++++++++-
2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/bin/rc.init b/bin/rc.init @@ -37,10 +37,10 @@ case $HARDWARECLOCK in "") ;; UTC) - HWCLOCK_PARAMS="${HWCLOCK_PARAMS} -u" + HWCLOCK_PARAMS="-u $HWCLOCK_PARAMS" ;; localtime) - HWCLOCK_PARAMS="${HWCLOCK_PARAMS} -l" + HWCLOCK_PARAMS="-l $HWCLOCK_PARAMS" ;; *) HWCLOCK_PARAMS="" diff --git a/bin/rc.shutdown b/bin/rc.shutdown @@ -15,7 +15,27 @@ esac echo Shutting down -hwclock -u -w +HWCLOCK_PARAMS="-w" +case $HARDWARECLOCK in + "") + ;; + UTC) + HWCLOCK_PARAMS="-u $HWCLOCK_PARAMS" + ;; + localtime) + HWCLOCK_PARAMS="-l $HWCLOCK_PARAMS" + ;; + *) + HWCLOCK_PARAMS="" + ;; +esac + +if [ -n "$HWCLOCK_PARAMS" ]; then + echo Saving system clock + [ -n "$TIMEZONE" ] && export TZ="$TIMEZONE" + hwclock $HWCLOCK_PARAMS + unset TZ +fi svc -k