mirror of
https://git.myvelabs.com/lab/nginx.git
synced 2025-12-17 21:26:13 +00:00
Update nginx.sh
This commit is contained in:
parent
b000903e83
commit
10051ae51a
1 changed files with 11 additions and 11 deletions
22
nginx.sh
22
nginx.sh
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue