improve scripts

This commit is contained in:
openoms
2022-02-13 15:59:01 +00:00
parent 04a7618dfd
commit 2d6a05aa8f
2 changed files with 21 additions and 13 deletions

View File

@@ -1,13 +1,18 @@
echo "Input your email:
#!/bin/bash
echo "
Input your email:
"
read EMAIL
echo "Input a subdomain set up with an A record pointing to this server:
echo "
Input a subdomain set up with an A record pointing to this server:
eg.: mempool.example.com
"
read SUBDOMAIN
echo "Input the URL to be redirected to:
echo "
Input the URL to be redirected to:
eg.: https://192.168.1.42:4081
"
read REDIRECT
@@ -21,11 +26,10 @@ sudo certbot certonly -a standalone -m $EMAIL --agree-tos \
#sudo cat /etc/letsencrypt/live/$SUBDOMAIN/privkey.pem
# Add to /etc/nginx/sites-available/btcpayserver
echo "
echo "\
server {
listen 443 ssl;
server_name $SUBDOMAIN;
ssl on;
ssl_certificate /etc/letsencrypt/live/$SUBDOMAIN/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/$SUBDOMAIN/privkey.pem;
@@ -42,14 +46,13 @@ server {
location / {
proxy_pass $REDIRECT;
}
}" | sudo tee /etc/nginx/sites-available/$SUBDOMAIN
sudo nano /etc/nginx/sites-available/$SUBDOMAIN
# edit with
# sudo nano /etc/nginx/sites-available/$SUBDOMAIN
sudo ln -s /etc/nginx/sites-available/$SUBDOMAIN /etc/nginx/sites-enabled/
sudo nginx -t || exit 1
sudo systemctl restart nginx
sudo systemctl reload nginx

View File

@@ -1,13 +1,18 @@
echo "Input your email:
#!/bin/bash
echo "
Input your email:
"
read EMAIL
echo "Input a subdomain set up with an A record pointing to this server:
echo "
Input a subdomain set up with an A record pointing to this server:
eg.: electrum.example.com
"
read SUBDOMAIN
echo "Input the TCP port of the Electrum Server to be redirected to:
echo "
Input the TCP port of the Electrum Server to be redirected to:
eg.: https://192.168.1.42:50021
"
read REDIRECT
@@ -73,4 +78,4 @@ stream {
sudo nginx -t || exit 1
# restart
sudo systemctl restart nginx
sudo systemctl reload nginx