From 47b1e68c8e451b75c7aece2568a63653c9c6b7b3 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 1 Dec 2015 17:54:42 +0000 Subject: [PATCH] Peg zeronet forum to a commit --- src/freedombone | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/freedombone b/src/freedombone index a34c4856..f2cdbdba 100755 --- a/src/freedombone +++ b/src/freedombone @@ -1975,6 +1975,24 @@ function install_zeronet_forum { return fi + # update to the next commit + if [ -d /opt/zeronet/ZeroTalk ]; then + if grep -q "ZeroNet Forum commit" $COMPLETION_FILE; then + CURRENT_ZERONET_FORUM_COMMIT=$(grep "ZeroNet Forum commit" $COMPLETION_FILE | awk -F ':' '{print $2}') + if [[ "$CURRENT_ZERONET_FORUM_COMMIT" != "$ZERONET_FORUM_COMMIT" ]]; then + cd /opt/zeronet/ZeroTalk + git stash + git checkout master + git pull + git checkout $ZERONET_FORUM_COMMIT + git checkout -b $ZERONET_FORUM_COMMIT + sed -i "s/ZeroNet Forum commit.*/ZeroNet Forum commit:$ZERONET_FORUM_COMMIT/g" $COMPLETION_FILE + fi + else + echo "ZeroNet Forum commit:$ZERONET_FORUM_COMMIT" >> $COMPLETION_FILE + fi + fi + if grep -Fxq "install_zeronet_forum" $COMPLETION_FILE; then return fi @@ -2029,6 +2047,14 @@ function install_zeronet_forum { echo $'ZeroTalk repo could not be cloned' exit 6739 fi + git checkout $ZERONET_FORUM_COMMIT + git checkout -b $ZERONET_FORUM_COMMIT + if ! grep -q "ZeroNet Forum commit" $COMPLETION_FILE; then + echo "ZeroNet Forum commit:$ZERONET_FORUM_COMMIT" >> $COMPLETION_FILE + else + sed -i "s/ZeroNet Forum commit.*/ZeroNet Forum commit:$ZERONET_FORUM_COMMIT/g" $COMPLETION_FILE + fi + echo $"Forum address: $ZERONET_FORUM_ADDRESS" echo $"Forum private key: $ZERONET_FORUM_PRIVATE_KEY" cp -r /opt/zeronet/ZeroTalk/* /opt/zeronet/data/$ZERONET_FORUM_ADDRESS