From 1bf712abc30e0889bef466479a3091c4ab0a1dec Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 29 Nov 2015 22:17:30 +0000 Subject: [PATCH] Use tlsdate from debian repos The aforementioned bug should now be fixed --- src/freedombone | 96 +------------------------------------------------ 1 file changed, 1 insertion(+), 95 deletions(-) diff --git a/src/freedombone b/src/freedombone index 9cde2a40..589ec946 100755 --- a/src/freedombone +++ b/src/freedombone @@ -91,9 +91,6 @@ DDNS_USERNAME= DDNS_PASSWORD= CURRENT_DDNS_DOMAIN= -TLSDATE_REPO="https://github.com/ioerror/tlsdate.git" -TLSDATE_COMMIT='ae396da167a9e43ce10c2db0956fb2e2b0d400ea' - INADYN_REPO="https://github.com/bashrc/inadyn" INADYN_COMMIT='fadbe17f520d337dfb8d69ee4bf1fcaa23fce0d6' @@ -867,12 +864,6 @@ function read_configuration { if grep -q "IPFS_COMMIT" $CONFIGURATION_FILE; then IPFS_COMMIT=$(grep "IPFS_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') fi - if grep -q "TLSDATE_REPO" $CONFIGURATION_FILE; then - TLSDATE_REPO=$(grep "TLSDATE_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi - if grep -q "TLSDATE_COMMIT" $CONFIGURATION_FILE; then - TLSDATE_COMMIT=$(grep "TLSDATE_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') - fi if grep -q "GNUSOCIAL_COMMIT" $CONFIGURATION_FILE; then GNUSOCIAL_COMMIT=$(grep "GNUSOCIAL_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') fi @@ -6476,60 +6467,11 @@ function time_synchronisation { return fi - # update to the next commit - if [ -d $INSTALL_DIR/tlsdate ]; then - if grep -q "tlsdate commit" $COMPLETION_FILE; then - CURRENT_TLSDATE_COMMIT=$(grep "tlsdate commit" $COMPLETION_FILE | awk -F ':' '{print $2}') - if [[ "$CURRENT_TLSDATE_COMMIT" != "$TLSDATE_COMMIT" ]]; then - cd $INSTALL_DIR/tlsdate - git stash - git checkout master - git pull - git checkout $TLSDATE_COMMIT - git checkout -b $TLSDATE_COMMIT - sed -i "s/tlsdate commit.*/tlsdate commit:$TLSDATE_COMMIT/g" $COMPLETION_FILE - ./autogen.sh - ./configure - make - make install - cp /usr/local/bin/tlsdate* /usr/bin - cp /usr/local/sbin/tlsdate* /usr/bin - fi - else - echo "tlsdate commit:$TLSDATE_COMMIT" >> $COMPLETION_FILE - fi - fi - if grep -Fxq "time_synchronisation" $COMPLETION_FILE; then return fi - #apt-get -y install tlsdate - - # building tlsdate from source is a workaround because of - # this bug https://github.com/ioerror/tlsdate/issues/130 - apt-get -y install build-essential automake git pkg-config autoconf libtool libssl-dev libevent-dev - - if [ ! -d $INSTALL_DIR ]; then - mkdir $INSTALL_DIR - fi - cd $INSTALL_DIR - git clone $TLSDATE_REPO - cd $INSTALL_DIR/tlsdate - git checkout $TLSDATE_COMMIT - git checkout -b $TLSDATE_COMMIT - if ! grep -q "tlsdate commit" $COMPLETION_FILE; then - echo "tlsdate commit:$TLSDATE_COMMIT" >> $COMPLETION_FILE - else - sed -i "s/tlsdate commit.*/tlsdate commit:$TLSDATE_COMMIT/g" $COMPLETION_FILE - fi - - ./autogen.sh - ./configure - make - make install - cp /usr/local/bin/tlsdate* /usr/bin - cp /usr/local/sbin/tlsdate* /usr/bin + apt-get -y install tlsdate apt-get -y remove ntpdate echo '#!/bin/bash' > /usr/bin/updatedate @@ -6607,42 +6549,6 @@ function time_synchronisation { echo '*/15 * * * * root /usr/bin/updatedate' >> /etc/crontab service cron restart - echo '#!/bin/bash' > /etc/init.d/tlsdate - echo '# /etc/init.d/tlsdate' >> /etc/init.d/tlsdate - echo '### BEGIN INIT INFO' >> /etc/init.d/tlsdate - echo '# Provides: tlsdate' >> /etc/init.d/tlsdate - echo '# Required-Start: $remote_fs $syslog' >> /etc/init.d/tlsdate - echo '# Required-Stop: $remote_fs $syslog' >> /etc/init.d/tlsdate - echo '# Default-Start: 2 3 4 5' >> /etc/init.d/tlsdate - echo '# Default-Stop: 0 1 6' >> /etc/init.d/tlsdate - echo '# Short-Description: Initially calls tlsdate with the timewarp option' >> /etc/init.d/tlsdate - echo '# Description: Initially calls tlsdate with the timewarp option' >> /etc/init.d/tlsdate - echo '### END INIT INFO' >> /etc/init.d/tlsdate - echo '# Author: Bob Mottram ' >> /etc/init.d/tlsdate - echo 'PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/sbin:/usr/sbin:/bin"' >> /etc/init.d/tlsdate - echo 'LOGFILE="/var/log/tlsdate.log"' >> /etc/init.d/tlsdate - echo 'TLSDATECOMMAND="tlsdate --timewarp -l -H www.ptb.de -p 443 >> $LOGFILE"' >> /etc/init.d/tlsdate - echo '#Start-Stop here' >> /etc/init.d/tlsdate - echo 'case "$1" in' >> /etc/init.d/tlsdate - echo ' start)' >> /etc/init.d/tlsdate - echo ' echo "tlsdate started"' >> /etc/init.d/tlsdate - echo ' $TLSDATECOMMAND' >> /etc/init.d/tlsdate - echo ' ;;' >> /etc/init.d/tlsdate - echo ' stop)' >> /etc/init.d/tlsdate - echo ' echo "tlsdate stopped"' >> /etc/init.d/tlsdate - echo ' ;;' >> /etc/init.d/tlsdate - echo ' restart)' >> /etc/init.d/tlsdate - echo ' echo "tlsdate restarted"' >> /etc/init.d/tlsdate - echo ' $TLSDATECOMMAND' >> /etc/init.d/tlsdate - echo ' ;;' >> /etc/init.d/tlsdate - echo ' *)' >> /etc/init.d/tlsdate - echo ' echo "Usage: $0 {start|stop|restart}"' >> /etc/init.d/tlsdate - echo ' exit 1' >> /etc/init.d/tlsdate - echo ' ;;' >> /etc/init.d/tlsdate - echo 'esac' >> /etc/init.d/tlsdate - echo 'exit 0' >> /etc/init.d/tlsdate - chmod +x /etc/init.d/tlsdate - update-rc.d tlsdate defaults echo 'time_synchronisation' >> $COMPLETION_FILE }