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