Fix issue where Caravan re-installs on first upgrade for new image

This commit is contained in:
Taylor Helsper 2021-04-27 22:23:20 -05:00
parent 4178b70836
commit b59c944b97
3 changed files with 3 additions and 2 deletions

View File

@ -412,7 +412,6 @@ cd ~
# Install Caravan # Install Caravan
CARAVAN_UPGRADE_URL=https://github.com/unchained-capital/caravan/archive/$CARAVAN_VERSION.tar.gz CARAVAN_UPGRADE_URL=https://github.com/unchained-capital/caravan/archive/$CARAVAN_VERSION.tar.gz
CARAVAN_SETTINGS_UPDATE_FILE=/home/bitcoin/.mynode/caravan_settings_1
CURRENT="" CURRENT=""
if [ -f $CARAVAN_VERSION_FILE ]; then if [ -f $CARAVAN_VERSION_FILE ]; then
CURRENT=$(cat $CARAVAN_VERSION_FILE) CURRENT=$(cat $CARAVAN_VERSION_FILE)

View File

@ -41,6 +41,7 @@ LNDHUB_VERSION_FILE=/home/bitcoin/.mynode/lndhub_version
LNDHUB_LATEST_VERSION_FILE=/home/bitcoin/.mynode/lndhub_version_latest LNDHUB_LATEST_VERSION_FILE=/home/bitcoin/.mynode/lndhub_version_latest
CARAVAN_VERSION="v0.3.5" CARAVAN_VERSION="v0.3.5"
CARAVAN_SETTINGS_UPDATE_FILE=/home/bitcoin/.mynode/caravan_settings_1
CARAVAN_VERSION_FILE=/home/bitcoin/.mynode/caravan_version CARAVAN_VERSION_FILE=/home/bitcoin/.mynode/caravan_version
CARAVAN_LATEST_VERSION_FILE=/home/bitcoin/.mynode/caravan_version_latest CARAVAN_LATEST_VERSION_FILE=/home/bitcoin/.mynode/caravan_version_latest

View File

@ -521,7 +521,7 @@ CURRENT=""
if [ -f $CARAVAN_VERSION_FILE ]; then if [ -f $CARAVAN_VERSION_FILE ]; then
CURRENT=$(cat $CARAVAN_VERSION_FILE) CURRENT=$(cat $CARAVAN_VERSION_FILE)
fi fi
if [ "$CURRENT" != "$CARAVAN_VERSION" ]; then if [ "$CURRENT" != "$CARAVAN_VERSION" ] || [ ! -f $CARAVAN_SETTINGS_UPDATE_FILE ]; then
cd /opt/mynode cd /opt/mynode
rm -rf caravan rm -rf caravan
@ -535,6 +535,7 @@ if [ "$CURRENT" != "$CARAVAN_VERSION" ]; then
cd caravan cd caravan
sudo -u bitcoin npm install --only=production sudo -u bitcoin npm install --only=production
echo $CARAVAN_VERSION > $CARAVAN_VERSION_FILE echo $CARAVAN_VERSION > $CARAVAN_VERSION_FILE
touch $CARAVAN_SETTINGS_UPDATE_FILE
fi fi
cd ~ cd ~