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, -1,
30, 30,
44, 44,
690, 694,
-1, -1,
-1, -1,
-1, -1,
-1, -1,
-1, -1,
682 686
] ]
} }
] ]

View File

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