btcpaysetdomain: add on option

This commit is contained in:
openoms
2021-03-29 22:56:44 +01:00
parent 30dc394ac5
commit 27bdc363a3

View File

@@ -2,15 +2,16 @@
# On a raspiblitz:
## download
# wget https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/BTCPayServer/bonus.btcpaysetdomain.sh
# wget -O bonus.btcpaysetdomain.sh https://raw.githubusercontent.com/openoms/bitcoin-tutorials/master/BTCPayServer/bonus.btcpaysetdomain.sh
## inspect
# cat bonus.btcpaysetdomain.sh
## run and follow the instructions on screen
# bash bonus.btcpaysetdomain.sh
# bash bonus.btcpaysetdomain.sh on
# To undo the conf changes use:
# bash bonus.btcpaysetdomain.sh revert
if [ $1 = on ];then
echo "# Custom script to set up nginx and the SSL certificate for BTCPay Server"
source /mnt/hdd/raspiblitz.conf
@@ -20,7 +21,6 @@ if ! grep -Eq "^BTCPayDomain=" /mnt/hdd/raspiblitz.conf; then
fi
echo " # Setting up Nginx and Certbot"
localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
echo
echo "***"
@@ -53,7 +53,7 @@ echo " # Setting up Nginx and Certbot"
# install nginx and certbot
sudo pip install cffi
sudo apt uupdate
sudo apt update
sudo apt-get install -y nginx-full certbot
sudo ufw allow 80 comment 'HTTP web server'
@@ -174,8 +174,8 @@ server {
# test
sudo nginx -t
# reload
sudo systemctl reload nginx
# restart
sudo systemctl restart nginx
echo "# Setting up certbot-auto renewal service"
@@ -217,7 +217,7 @@ echo "# setting value in raspiblitz config"
sudo sed -i "s/^BTCPayDomain=.*/BTCPayDomain=$YOUR_DOMAIN/g" /mnt/hdd/raspiblitz.conf
echo "OK done"
fi
if [ $1 = revert ];then
echo "# Revert the nginx configs"
@@ -242,4 +242,3 @@ if [ $1 = revert ];then
# reload
sudo systemctl reload nginx
fi