Update nginx.sh

This commit is contained in:
myve 2025-03-17 01:23:47 +00:00
commit 10051ae51a

View file

@ -7,7 +7,7 @@ eff_email_address=${eff_email_address} # eg, eff@web.com
appname=${appname} # eg, nextcloud
subdomain=${subdomain} # eg, cloud
domain=${domain} # eg, web.com
adddomains=(${adddomains}) # eg, web2.com web3.comf
adddomains=(${adddomains//,/ }) # eg, web2.com web3.comf
host=${host} # eg, 127.0.0.1
port=${port} # eg, 65000
backup_port=${backup_port} # eg, 65000 (defaults to localhost 127.0.0.1 as host)
@ -26,6 +26,16 @@ do
addurl+=(${subdomain}.${add})
done
# Abort if variables are missing
for var in eff_email_address appname domain host port
do
if [ -z ${!var} ]
then
echo "Variable ${var} does not exist, aborting..."
exit 1
fi
done
# Figure out nginx conf directory
if grep -q 'include.*conf.d' /etc/nginx/nginx.conf
then
@ -39,16 +49,6 @@ else
exit 1
fi
# Exit if variables are missing
for var in eff_email_address appname domain host port
do
if [ -z ${!var} ]
then
echo "Variable ${var} does not exist, aborting..."
exit 1
fi
done
# Add backup directive to nginx.conf if supplied
if [ ${backup_port} ]
then