If /etc/timestamp was more then 1hr recent than the output from date, the
script would set the date from the /etc/timestamp before rewriting it.
Because of this it was not possible to adjust the date more than one
hour backwards.

Signed-off-by: Tasslehoff Kjappfot <tasskj...@gmail.com>
---
 .../systemd/timestamp-service/load-timestamp.sh    |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/recipes-core/systemd/timestamp-service/load-timestamp.sh 
b/recipes-core/systemd/timestamp-service/load-timestamp.sh
index 82c69f6..9d42026 100755
--- a/recipes-core/systemd/timestamp-service/load-timestamp.sh
+++ b/recipes-core/systemd/timestamp-service/load-timestamp.sh
@@ -1,5 +1,10 @@
 #!/bin/sh
 
+if [ "$1" = "--save" ] ; then
+    /bin/date -u +%2m%2d%2H%2M%4Y > /etc/timestamp
+    exit $?
+fi
+
 # Set the system clock from hardware clock
 # If the timestamp is 1 day or more recent than the current time,
 # use the timestamp instead.
@@ -17,6 +22,3 @@ if [ $SYSTEMDATE -lt $TIMESTAMP ]; then
        date -u $(cat /etc/timestamp)
 fi
 
-if [ "$1" = "--save" ] ; then
-       /bin/date -u +%2m%2d%2H%2M%4Y > /etc/timestamp
-fi
-- 
1.7.9.5


_______________________________________________
Angstrom-distro-devel mailing list
Angstrom-distro-devel@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/angstrom-distro-devel

Reply via email to