Use unix dates

This commit is contained in:
Bob Mottram 2015-03-29 11:03:15 +01:00
parent b8510b4bfc
commit ef5433b61e
1 changed files with 3 additions and 3 deletions

View File

@ -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