Check that the previous date file contains some characters
This commit is contained in:
parent
ef5433b61e
commit
e5350c18ce
|
@ -4779,6 +4779,8 @@ function time_synchronisation {
|
||||||
echo '# If the date was previously set' >> /usr/bin/updatedate
|
echo '# If the date was previously set' >> /usr/bin/updatedate
|
||||||
echo 'if [ -s "$BEFORE_DATE_FILE" ]; then' >> /usr/bin/updatedate
|
echo 'if [ -s "$BEFORE_DATE_FILE" ]; then' >> /usr/bin/updatedate
|
||||||
echo ' BEFORE_FILE=$(cat $BEFORE_DATE_FILE)' >> /usr/bin/updatedate
|
echo ' BEFORE_FILE=$(cat $BEFORE_DATE_FILE)' >> /usr/bin/updatedate
|
||||||
|
echo ' filesize=$(wc -c "$BEFORE_DATE_FILE" | cut -f 1 -d " ")' >> /usr/bin/updatedate
|
||||||
|
echo ' if [ $filesize -ge 5 ]; then' >> /usr/bin/updatedate
|
||||||
echo ' BEFORE_FULLDATE=$(cat $BEFORE_FULLDATE_FILE)' >> /usr/bin/updatedate
|
echo ' BEFORE_FULLDATE=$(cat $BEFORE_FULLDATE_FILE)' >> /usr/bin/updatedate
|
||||||
echo ' # is the date going backwards?' >> /usr/bin/updatedate
|
echo ' # is the date going backwards?' >> /usr/bin/updatedate
|
||||||
echo ' if (( $BEFORE_FILE > $BEFORE )); then' >> /usr/bin/updatedate
|
echo ' if (( $BEFORE_FILE > $BEFORE )); then' >> /usr/bin/updatedate
|
||||||
|
@ -4793,6 +4795,7 @@ function time_synchronisation {
|
||||||
echo ' tlsdate >> $LOGFILE' >> /usr/bin/updatedate
|
echo ' tlsdate >> $LOGFILE' >> /usr/bin/updatedate
|
||||||
echo ' BACKWARDS_BETWEEN=1' >> /usr/bin/updatedate
|
echo ' BACKWARDS_BETWEEN=1' >> /usr/bin/updatedate
|
||||||
echo ' fi' >> /usr/bin/updatedate
|
echo ' fi' >> /usr/bin/updatedate
|
||||||
|
echo ' fi' >> /usr/bin/updatedate
|
||||||
echo 'fi' >> /usr/bin/updatedate
|
echo 'fi' >> /usr/bin/updatedate
|
||||||
echo '# Set the date' >> /usr/bin/updatedate
|
echo '# Set the date' >> /usr/bin/updatedate
|
||||||
echo '/usr/bin/timeout $TIMEOUT tlsdate -l -t -H $TIMESOURCE -p 443 >> $LOGFILE' >> /usr/bin/updatedate
|
echo '/usr/bin/timeout $TIMEOUT tlsdate -l -t -H $TIMESOURCE -p 443 >> $LOGFILE' >> /usr/bin/updatedate
|
||||||
|
|
Loading…
Reference in New Issue