allow to cancel BTCPay setup with dialog

This commit is contained in:
openoms 2019-12-05 16:17:40 +00:00
parent f062ab9a57
commit 7982626778

View file

@ -3,17 +3,53 @@
# script to set up nginx and the SSL certificate for BTCPay Server # script to set up nginx and the SSL certificate for BTCPay Server
# calls the config.scripts/internet.hiddenservice.sh for the Tor connection # calls the config.scripts/internet.hiddenservice.sh for the Tor connection
whiptail --title 'Install BTCPayServer' --yes-button='Own Domain' --no-button='Tor only' --yesno " HEIGHT=20
Choose 'Own Domain' if you want to use a Domain Name or dynamicDNS \ WIDTH=73
pointing to your public IP. CHOICE_HEIGHT=2
You will need the ports 80, 443 and 9735 forwarded to your RaspiBlitz \ BACKTITLE="RaspiBlitz"
and an email address to be used for communication about the SSL certificate.\n TITLE=""
Choose 'Tor only' if you want to set up BTCPayServer \ MENU="Choose 'DOMAIN' if you want to use a Domain Name or dynamicDNS
as a Tor Hidden service and use a self signed SSL certificate.\n pointing to your public IP.\n
You will need the ports 80, 443 and 9735 forwarded to your RaspiBlitz
and an email address to be used for communication about the SSL certificate.\n\n
Choose 'TOR' if you want to set up BTCPayServer
as a Tor Hidden service and use a self signed SSL certificate.\n\n
Find more information about using the BTCPayServer on the RaspiBlitz here: Find more information about using the BTCPayServer on the RaspiBlitz here:
https://github.com/openoms/bitcoin-tutorials/tree/master/BTCPayServer https://github.com/openoms/bitcoin-tutorials/tree/master/BTCPayServer"
https://openoms.gitbook.io/bitcoin-tutorials/btcpayserver OPTIONS=(DOMAIN "use a Domain Name or dynamicDNS" \
" 19 73 TOR "Tor access and a self-signed certificate")
CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \
--title "$TITLE" \
--menu "$MENU" \
$HEIGHT $WIDTH $CHOICE_HEIGHT \
"${OPTIONS[@]}" \
2>&1 >/dev/tty)
dialogcancel=$?
echo "done dialog"
clear
# check if user canceled dialog
echo "dialogcancel(${dialogcancel})"
if [ ${dialogcancel} -eq 1 ]; then
echo "user canceled"
exit 1
fi
clear
case $CHOICE in
DOMAIN)
echo "setting up with own domain"
ownDomain=1
;;
TOR)
echo "setting up for Tor only"
ownDomain=0
;;
esac
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "setting up with own domain" echo "setting up with own domain"
@ -33,16 +69,19 @@ if [ $ownDomain -eq 1 ]; then
echo "" echo ""
echo "***" echo "***"
echo "Confirm that the port 80, 443 and 9735 are forwarded to the IP of the RaspiBlitz by pressing [ENTER]" echo "Confirm that the port 80, 443 and 9735 are forwarded to the IP of the RaspiBlitz by pressing [ENTER]"
echo "Use CTRL + C to EXIT"
read key read key
echo "" echo ""
echo "***" echo "***"
echo "Type the domain/ddns you want to use for BTCPayServer and press [ENTER]" echo "Type the domain/ddns you want to use for BTCPayServer and press [ENTER]"
echo "Use CTRL + C to EXIT"
read YOUR_DOMAIN read YOUR_DOMAIN
echo "" echo ""
echo "***" echo "***"
echo "Type an email address that will be used to register the SSL certificate and press [ENTER]" echo "Type an email address that will be used to register the SSL certificate and press [ENTER]"
echo "Use CTRL + C to EXIT"
read YOUR_EMAIL read YOUR_EMAIL
echo "" echo ""