fix lnbits update options (#3307)

This commit is contained in:
openoms
2022-09-13 18:16:28 +01:00
committed by GitHub
parent 886b8fd7e4
commit 36057e6f87

View File

@@ -2,16 +2,22 @@
# https://github.com/lnbits/lnbits-legend
# https://github.com/lnbits/lnbits-legend/releases
tag="0.9.1"
# command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "small config script to switch LNbits on or off"
echo "Config script to switch LNbits on or off."
echo "Installs the version ${tag} by default."
echo "Usage:"
echo "bonus.lnbits.sh on [lnd|tlnd|slnd|cl|tcl|scl] [?GITHUBUSER] [?BRANCH|?TAG]"
echo "bonus.lnbits.sh switch [lnd|tlnd|slnd|cl|tcl|scl]"
echo "bonus.lnbits.sh off"
echo "bonus.lnbits.sh status"
echo "bonus.lnbits.sh menu"
echo "bonus.lnbits.sh prestart"
echo "bonus.lnbits.sh githubsync"
echo "bonus.lnbits.sh repo [githubuser] [branch]"
echo "bonus.lnbits.sh sync"
exit 1
fi
@@ -359,11 +365,11 @@ if [ "$1" = "repo" ]; then
# change origin repo of lnbits code
echo "# changing LNbits github repo(${githubUser}) branch(${githubBranch})"
cd /home/lnbits/lnbits
sudo git remote remove origin
sudo git remote add origin ${githubRepo}
sudo git fetch
sudo git checkout ${githubBranch}
sudo git branch --set-upstream-to=origin/${githubBranch} ${githubBranch}
sudo -u lnbits git remote remove origin
sudo -u lnbits git remote add origin ${githubRepo}
sudo -u lnbits git fetch
sudo -u lnbits git checkout ${githubBranch}
sudo -u lnbits git branch --set-upstream-to=origin/${githubBranch} ${githubBranch}
fi
@@ -371,10 +377,20 @@ if [ "$1" = "sync" ] || [ "$1" = "repo" ]; then
echo "# pull all changes from github repo"
# output basic info
cd /home/lnbits/lnbits
sudo git remote -v
sudo git branch -v
sudo -u lnbits git remote -v
sudo -u lnbits git branch -v
# pull latest code
sudo git pull
sudo -u lnbits git pull
# install
sudo -u lnbits python3 -m venv venv
sudo -u lnbits ./venv/bin/pip install -r requirements.txt
sudo -u lnbits ./venv/bin/pip install pylightning
sudo -u lnbits ./venv/bin/pip install secp256k1
sudo -u lnbits ./venv/bin/pip install pyln-client
# build
sudo -u lnbits ./venv/bin/python build.py
# restart lnbits service
sudo systemctl restart lnbits
echo "# server is restarting ... maybe takes some seconds until available"
@@ -453,8 +469,6 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
if [ "$3" != "" ]; then
githubUser="$3"
fi
# https://github.com/lnbits/lnbits-legend/releases
tag="0.9.1"
if [ "$4" != "" ]; then
tag="$4"
fi
@@ -490,6 +504,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo -u lnbits ./venv/bin/pip install -r requirements.txt
sudo -u lnbits ./venv/bin/pip install pylightning
sudo -u lnbits ./venv/bin/pip install secp256k1
sudo -u lnbits ./venv/bin/pip install pyln-client
# build
sudo -u lnbits ./venv/bin/python build.py