--- adjtime.cron | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/adjtime.cron b/adjtime.cron index b1c8950..a876506 100755 --- a/adjtime.cron +++ b/adjtime.cron @@ -4,14 +4,12 @@ . /etc/rc.conf HWCLOCK_PARAMS="--adjust" -if [ "$HARDWARECLOCK" = "UTC" ]; then - HWCLOCK_PARAMS="$HWCLOCK_PARAMS --utc" -elif [ "$HARDWARECLOCK" = "localtime" ]; then - HWCLOCK_PARAMS="$HWCLOCK_PARAMS --localtime" -else - HWCLOCK_PARAMS="" -fi +case $HARDWARECLOCK in + UTC) HWCLOCK_PARAMS+=" --utc";; + localtime) HWCLOCK_PARAMS+=" --localtime";; + *) HWCLOCK_PARAMS="";; +esac -if [ -n "$HWCLOCK_PARAMS" ]; then - /sbin/hwclock $HWCLOCK_PARAMS +if [[ $HWCLOCK_PARAMS ]]; then + /sbin/hwclock $HWCLOCK_PARAMS fi -- 1.7.1