Provide workaround for systemd's systemctl failures on jessie
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 18-timesetup
index 57c288b..da40243 100755 (executable)
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Filename:      /etc/grml/fai/config/scripts/GRMLBASE/18-timesetup
+#!/bin/bash
+# Filename:      ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/18-timesetup
 # Purpose:       apply default time and timezone settings
 # Authors:       (c) Thomas Lehmann <thomas.lehmann@kvt.de>
 # Bug-Reports:   send to author and see http://grml.org/bugs/
@@ -10,10 +10,10 @@ set -u
 set -e
 
 # tell if hwclock is running in UTC or local time
-# by default it's set to UTC=yes, we usually want UTC=no
-if [ -n "$UTC" ] ; then
-   echo "Setting hwclock parameter UTC to $UTC"
-   sed -i "s|^UTC=.*$|UTC="$UTC"|" $target/etc/default/rcS
+# by default it's set to UTC=no
+if [ -n "$UTC" ] && [ "$UTC" = "yes" ] ; then
+   echo "UTC is set to 'yes', setting hwclock parameter UTC"
+   sed -i "s/^LOCAL/UTC/" "${target}/etc/adjtime"
 fi
 
 # default timezone settings
@@ -31,4 +31,4 @@ if [ -n "$TIMEZONE" ] ; then
 fi
 
 ## END OF FILE ################################################################
-# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2