skip subst sections if useSSL=0

This commit is contained in:
Asif Bacchus 2019-01-06 05:27:28 -07:00
parent b476a8becf
commit 0cc7cb97a2
2 changed files with 14 additions and 10 deletions

View File

@ -6,13 +6,13 @@
-1,
30,
44,
690,
694,
-1,
-1,
-1,
-1,
-1,
682
686
]
}
]

View File

@ -644,15 +644,19 @@ for name in "${serverNames[@]}"; do
done
sed -i "/${tag_servernames}/d" "${configPath}/${file_servernames}"
# process SSL snippet
echo -e "updating ${warn}${configPath}/${file_ssl}${norm}"
sed -i -e "s%${tag_sslcert}%${CertPath}%" "${configPath}/${file_ssl}"
sed -i -e "s%${tag_sslkey}%${KeyPath}%" "${configPath}/${file_ssl}"
# process SSL snippet if using SSL
if [ "${useSSL}" -eq 1 ]; then
echo -e "updating ${warn}${configPath}/${file_ssl}${norm}"
sed -i -e "s%${tag_sslcert}%${CertPath}%" "${configPath}/${file_ssl}"
sed -i -e "s%${tag_sslkey}%${KeyPath}%" "${configPath}/${file_ssl}"
fi
# process mozModern SSL configuration
echo -e "updating ${warn}${configPath}/${file_mozmodern}${norm}"
sed -i -e "s%${tag_dhparam}%${DHPath}%" "${configPath}/${file_mozmodern}"
sed -i -e "s%${tag_cachain}%${CAChainPath}%" "${configPath}/${file_mozmodern}"
# process mozModern SSL configuration if using SSL
if [ "${useSSL}" -eq 1 ]; then
echo -e "updating ${warn}${configPath}/${file_mozmodern}${norm}"
sed -i -e "s%${tag_dhparam}%${DHPath}%" "${configPath}/${file_mozmodern}"
sed -i -e "s%${tag_cachain}%${CAChainPath}%" "${configPath}/${file_mozmodern}"
fi
# process LAN IP in nginx.conf
echo -e "updating ${warn}${configPath}/${file_lanip}${norm}"