#214 add auto-recover on recover

This commit is contained in:
rootzoll 2020-01-28 17:54:28 +01:00
parent 4e95faa0ec
commit b6a28f52dd
3 changed files with 19 additions and 8 deletions

View File

@ -454,7 +454,7 @@ if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${BTCPayServer}" != "${choice}" ]; then if [ "${BTCPayServer}" != "${choice}" ]; then
echo "BTCPayServer setting changed .." echo "BTCPayServer setting changed .."
anychange=1 anychange=1
/home/admin/config.scripts/bonus.btcpayserver.sh ${choice} /home/admin/config.scripts/bonus.btcpayserver.sh ${choice} tor
errorOnInstall=$? errorOnInstall=$?
if [ "${choice}" = "on" ]; then if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then if [ ${errorOnInstall} -eq 0 ]; then

View File

@ -255,8 +255,15 @@ fi
# BTCPAYSERVER - not restored due to need for domain name and port forwarding # BTCPAYSERVER - not restored due to need for domain name and port forwarding
if [ "${BTCPayServer}" = "on" ]; then if [ "${BTCPayServer}" = "on" ]; then
echo "Setting BTCPayServer to be off - will need to be reinstalled from the menu again" >> ${logFile}
sudo sed -i "s/^BTCPayServer=.*/BTCPayServer=off/g" /mnt/hdd/raspiblitz.conf if [ "${runBehindTor}" = "on" ]; && [ "${BTCPayDomain}" = "localhost" ] then
echo "Provisioning BTCPAYSERVER on TOR - run config script" >> ${logFile}
sudo -u admin /home/admin/config.scripts/bonus.btcpayserver.sh on tor >> ${logFile} 2>&1
else
# provisioning non-TOR BTCPayServer is not supported yet - needs manual reinstall
echo "Setting BTCPayServer to be off - will need to be reinstalled from the menu again" >> ${logFile}
sudo sed -i "s/^BTCPayServer=.*/BTCPayServer=off/g" /mnt/hdd/raspiblitz.conf
fi
else else
echo "Provisioning BTCPayServer - keep default" >> ${logFile} echo "Provisioning BTCPayServer - keep default" >> ${logFile}
fi fi
@ -341,8 +348,6 @@ else
echo "Provisioning UPS - not active" >> ${logFile} echo "Provisioning UPS - not active" >> ${logFile}
fi fi
# replay backup LND conf & tlscerts # replay backup LND conf & tlscerts
# https://github.com/rootzoll/raspiblitz/issues/324 # https://github.com/rootzoll/raspiblitz/issues/324
echo "" >> ${logFile} echo "" >> ${logFile}

View File

@ -5,7 +5,7 @@
# command info # command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "config script to switch BTCPay Server on or off" echo "config script to switch BTCPay Server on or off"
echo "bonus.btcpayserver.sh [on|off]" echo "bonus.btcpayserver.sh [on|off|menu] [ip|tor]"
exit 1 exit 1
fi fi
@ -66,8 +66,14 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
# echo "exiting as user cancelled BTCPayServer installation" # echo "exiting as user cancelled BTCPayServer installation"
# exit 1 # exit 1
#fi #fi
sudo sed -i "s/^BTCPayDomain=.*/BTCPayDomain='localhost'/g" /mnt/hdd/raspiblitz.conf
/home/admin/config.scripts/internet.hiddenservice.sh btcpay 80 23000 if [ "$2" == "tor" ]; then
sudo sed -i "s/^BTCPayDomain=.*/BTCPayDomain='localhost'/g" /mnt/hdd/raspiblitz.conf
/home/admin/config.scripts/internet.hiddenservice.sh btcpay 80 23000
else
echo "# FAIL - at the moment only BTCPay Server over TOR is supported"
exit 1
fi
# check for $BTCPayDomain # check for $BTCPayDomain
source /mnt/hdd/raspiblitz.conf source /mnt/hdd/raspiblitz.conf