From ef5433b61e097aee52c3deae51e16bb043e78ef2 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 29 Mar 2015 11:03:15 +0100 Subject: [PATCH] Use unix dates --- src/freedombone | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/freedombone b/src/freedombone index 3c95269f..a4a9d689 100755 --- a/src/freedombone +++ b/src/freedombone @@ -4774,7 +4774,7 @@ function time_synchronisation { echo '# File which contains the previous date as a string' >> /usr/bin/updatedate echo 'BEFORE_FULLDATE_FILE=/var/log/tlsdate.txt' >> /usr/bin/updatedate echo 'DATE_BEFORE=$(date)' >> /usr/bin/updatedate - echo 'BEFORE=$(date +%Y-%M-%D)' >> /usr/bin/updatedate + echo 'BEFORE=$(date "+%s")' >> /usr/bin/updatedate echo 'BACKWARDS_BETWEEN=0' >> /usr/bin/updatedate echo '# If the date was previously set' >> /usr/bin/updatedate echo 'if [ -s "$BEFORE_DATE_FILE" ]; then' >> /usr/bin/updatedate @@ -4797,7 +4797,7 @@ function time_synchronisation { echo '# Set the date' >> /usr/bin/updatedate echo '/usr/bin/timeout $TIMEOUT tlsdate -l -t -H $TIMESOURCE -p 443 >> $LOGFILE' >> /usr/bin/updatedate echo 'DATE_AFTER=$(date)' >> /usr/bin/updatedate - echo 'AFTER=$(date +%Y-%M-%D)' >> /usr/bin/updatedate + echo 'AFTER=$(date "+%s")' >> /usr/bin/updatedate echo '# After setting the date did it go backwards?' >> /usr/bin/updatedate echo 'if (( $AFTER < $BEFORE )); then' >> /usr/bin/updatedate echo ' echo "Incorrect date: $DATE_BEFORE -> $DATE_AFTER" >> $LOGFILE' >> /usr/bin/updatedate @@ -4806,7 +4806,7 @@ function time_synchronisation { echo ' # Try resetting the date from another time source' >> /usr/bin/updatedate echo ' /usr/bin/timeout $TIMEOUT tlsdate -l -t -H $TIMESOURCE2 -p 443 >> $LOGFILE' >> /usr/bin/updatedate echo ' DATE_AFTER=$(date)' >> /usr/bin/updatedate - echo ' AFTER=$(date +%Y-%M-%D)' >> /usr/bin/updatedate + echo ' AFTER=$(date "+%s")' >> /usr/bin/updatedate echo 'else' >> /usr/bin/updatedate echo ' echo -n $TIMESOURCE >> $LOGFILE' >> /usr/bin/updatedate echo ' if [ -s "$BEFORE_DATE_FILE" ]; then' >> /usr/bin/updatedate