Peg zeronet forum to a commit

This commit is contained in:
Bob Mottram 2015-12-01 17:54:42 +00:00
parent f1b38ac5fc
commit 47b1e68c8e
1 changed files with 26 additions and 0 deletions

View File

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