diff --git a/recipes-core/systemd/timestamp-service/load-timestamp.sh b/recipes-core/systemd/timestamp-service/load-timestamp.sh old mode 100755 new mode 100644 index d65c729..9ad0e94 --- a/recipes-core/systemd/timestamp-service/load-timestamp.sh +++ b/recipes-core/systemd/timestamp-service/load-timestamp.sh @@ -1,8 +1,11 @@ #!/bin/sh -# Set the system clock from hardware clock -# If the timestamp is 1 day or more recent than the current time, -# use the timestamp instead. +if [ "$1" != "--save" ] ; then + +# Set the system clock from timestamp file +# if the timestamp is 1 minute or more recent +# than the current systemtime. + SYSTEMDATE=$(/bin/date -u "+%4Y%2m%2d%2H%2M") TIMESTAMP=$(/bin/cat /etc/timestamp 2>/dev/null) @@ -12,7 +15,7 @@ if [ $SYSTEMDATE -lt $TIMESTAMP ] 2>/dev/null ; then /bin/date -u ${TIMESTAMP#????}${TIMESTAMP%????????} fi -if [ "$1" = "--save" ] ; then +else +# Store the current systemtime in /etc/timestamp /bin/date -u +%4Y%2m%2d%2H%2M > /etc/timestamp fi -