Skip to content

Commit

Permalink
fixed wrong checks on nginx conf creations
Browse files Browse the repository at this point in the history
  • Loading branch information
Cielquan committed Aug 7, 2019
1 parent 89569af commit cf832e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ if ! [ -f nginx-docker/configs/sites-enabled/"${HOST_IP}".conf ] || echo "${FRES
else
echo "SUCCESS! Found '${HOST_IP}.conf' file."
fi
if [ -f nginx-docker/configs/snippets/cert_"${HOST_IP}".conf ] || echo "${FRESH}" | grep -q 'y'; then
if ! [ -f nginx-docker/configs/snippets/cert_"${HOST_IP}".conf ] || echo "${FRESH}" | grep -q 'y'; then
if ! cp nginx-docker/templates/cert_HOST_IP.conf.template nginx-docker/configs/snippets/cert_"${HOST_IP}".conf; then
echo "ERROR! 'cert_HOST_IP.conf.template' could not be copied."
exit_err
Expand All @@ -286,7 +286,7 @@ else
echo "SUCCESS! Found 'cert_${HOST_IP}.conf' file."
fi
#Conf files based on DOMAIN
if [ -f nginx-docker/configs/sites-enabled/"${DOMAIN}".conf ] || echo "${FRESH}" | grep -q 'y'; then
if ! [ -f nginx-docker/configs/sites-enabled/"${DOMAIN}".conf ] || echo "${FRESH}" | grep -q 'y'; then
if ! cp nginx-docker/templates/DOMAIN.conf.template nginx-docker/configs/sites-enabled/"${DOMAIN}".conf; then
echo "ERROR! 'DOMAIN.conf.template' could not be copied."
exit_err
Expand All @@ -299,7 +299,7 @@ if [ -f nginx-docker/configs/sites-enabled/"${DOMAIN}".conf ] || echo "${FRESH}"
else
echo "SUCCESS! Found '${DOMAIN}.conf' file."
fi
if [ -f nginx-docker/configs/snippets/cert_"${DOMAIN}".conf ] || echo "${FRESH}" | grep -q 'y'; then
if ! [ -f nginx-docker/configs/snippets/cert_"${DOMAIN}".conf ] || echo "${FRESH}" | grep -q 'y'; then
if ! cp nginx-docker/templates/cert_DOMAIN.conf.template nginx-docker/configs/snippets/cert_"${DOMAIN}".conf; then
echo "ERROR! 'cert_DOMAIN.conf' could not be copied."
exit_err
Expand All @@ -313,7 +313,7 @@ else
echo "SUCCESS! Found 'cert_${DOMAIN}.conf' file."
fi
# Conf file for DoT
if [ -f nginx-docker/configs/streams/dns-over-tls.conf ] || echo "${FRESH}" | grep -q 'y'; then
if ! [ -f nginx-docker/configs/streams/dns-over-tls.conf ] || echo "${FRESH}" | grep -q 'y'; then
if ! cp nginx-docker/templates/dns-over-tls.conf.template nginx-docker/configs/streams/dns-over-tls.conf; then
echo "ERROR! 'dns-over-tls.conf.template' could not be copied."
exit_err
Expand Down

0 comments on commit cf832e5

Please sign in to comment.