#1740 adding pool to recovery & SSH menus (#1747)

This commit is contained in:
Christian Rotzoll 2020-11-06 18:13:06 +01:00 committed by rootzoll
parent 99a652f3cf
commit 654aa290e4
5 changed files with 42 additions and 7 deletions

View file

@ -107,6 +107,9 @@ fi
if [ "${zerotier}" == "on" ]; then
OPTIONS+=(ZEROTIER "ZeroTier")
fi
if [ "${pool}" == "on" ]; then
OPTIONS+=(POOL "Lightning Pool")
fi
# Basic Options
OPTIONS+=(INFO "RaspiBlitz Status Screen")
@ -234,7 +237,7 @@ case $CHOICE in
BOS)
sudo /home/admin/config.scripts/bonus.bos.sh menu
;;
PYBLOCK)
PYBLOCK)
sudo /home/admin/config.scripts/bonus.pyblock.sh menu
;;
THUB)
@ -243,6 +246,9 @@ case $CHOICE in
ZEROTIER)
sudo /home/admin/config.scripts/bonus.zerotier.sh menu
;;
POOL)
sudo /home/admin/config.scripts/bonus.pool.sh menu
;;
SUBSCRIBE)
/home/admin/config.scripts/blitz.subscriptions.py
;;

View file

@ -20,6 +20,7 @@ if [ ${#faraday} -eq 0 ]; then faraday="off"; fi
if [ ${#bos} -eq 0 ]; then bos="off"; fi
if [ ${#pyblock} -eq 0 ]; then pyblock="off"; fi
if [ ${#thunderhub} -eq 0 ]; then thunderhub="off"; fi
if [ ${#pool} -eq 0 ]; then pool="off"; fi
# show select dialog
echo "run dialog ..."
@ -39,6 +40,7 @@ OPTIONS+=(o 'Balance of Satoshis' ${bos})
OPTIONS+=(y 'PyBLOCK' ${pyblock})
OPTIONS+=(f 'Faraday' ${faraday})
OPTIONS+=(m 'lndmanage' ${lndmanage})
OPTIONS+=(c 'Lightning Pool' ${pool})
CHOICES=$(dialog --title ' Additional Services ' --checklist ' use spacebar to activate/de-activate ' 20 45 12 "${OPTIONS[@]}" 2>&1 >/dev/tty)
@ -347,6 +349,20 @@ else
echo "LNbits setting unchanged."
fi
# Lightning Pool
choice="off"; check=$(echo "${CHOICES}" | grep -c "c")
if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${pool}" != "${choice}" ]; then
echo "Pool Setting changed .."
anychange=1
sudo -u admin /home/admin/config.scripts/bonus.pool.sh ${choice}
if [ "${choice}" = "on" ]; then
sudo -u admin /home/admin/config.scripts/bonus.pool.sh menu
fi
else
echo "Pool setting unchanged."
fi
# JoinMarket process choice
choice="off"; check=$(echo "${CHOICES}" | grep -c "j")
if [ ${check} -eq 1 ]; then choice="on"; fi

View file

@ -519,6 +519,15 @@ else
echo "Provisioning Stacking Sats Kraken - keep default" >> ${logFile}
fi
# pool
if [ "${pool}" = "on" ]; then
echo "Provisioning Pool - run config script" >> ${logFile}
sudo sed -i "s/^message=.*/message='Setup Pool'/g" ${infoFile}
sudo -u admin /home/admin/config.scripts/bonus.pool.sh on >> ${logFile} 2>&1
else
echo "Provisioning Pool - keep default" >> ${logFile}
fi
# custom install script from user
customInstallAvailable=$(sudo ls /mnt/hdd/app-data/custom-installs.sh 2>/dev/null | grep -c "custom-installs.sh")
if [ ${customInstallAvailable} -gt 0 ]; then

View file

@ -147,6 +147,7 @@ function jm() {
if [ $(grep -c "joinmarket=on" < /mnt/hdd/raspiblitz.conf) -eq 1 ]; then
echo "# switching to the joinmarket user with the command: 'sudo su - joinmarket'"
sudo su - joinmarket
echo "# use command 'raspiblitz' to return to menu"
else
echo "JoinMarket is not installed - to install run:"
echo "sudo /home/admin/config.scripts/bonus.joinmarket.sh on"
@ -158,8 +159,8 @@ function jm() {
function faraday() {
if [ $(grep -c "faraday=on" < /mnt/hdd/raspiblitz.conf) -eq 1 ]; then
echo "# switching to the faraday user with the command: 'sudo su - faraday'"
echo "# when done use command 'exit' to return to admin user"
echo "# see faraday options with --> frcli -help"
echo "# use command 'exit' and then 'raspiblitz' to return to menu"
echo "# use command 'frcli --help' now to get more info"
sudo su - faraday
else
echo "Faraday is not installed - to install run:"
@ -172,6 +173,8 @@ function faraday() {
function loop() {
if [ $(grep -c "loop=on" < /mnt/hdd/raspiblitz.conf) -eq 1 ]; then
echo "# switching to the loop user with the command: 'sudo su - loop'"
echo "# use command 'exit' and then 'raspiblitz' to return to menu"
echo "# use command 'loop --help' now to get more info"
sudo su - loop
else
echo "Lightning Loop is not installed - to install run:"
@ -184,6 +187,8 @@ function loop() {
function pool() {
if [ $(grep -c "pool=on" < /mnt/hdd/raspiblitz.conf) -gt 0 ]; then
echo "# switching to the pool user with the command: 'sudo su - pool'"
echo "# use command 'exit' and then 'raspiblitz' to return to menu"
echo "# use command 'pool --help' now to get more info"
sudo su - pool
else
echo "Pool is not installed - to install run:"

View file

@ -20,11 +20,10 @@ fi
# show info menu
if [ "$1" = "menu" ]; then
dialog --title " Info Pool Service " --msgbox "\n\
whiptail --title " Info Pool Service " --msgbox "\
Usage and examples: https://github.com/lightninglabs/pool\n
Use the shortcut 'pool' in the terminal to switch to the dedicated user.\n
Type 'pool' again to see the options.
" 11 56
Use the shortcut 'pool' in the terminal to switch to the dedicated user and type 'pool' again to see the options.
" 12 56
exit 0
fi