added certificate path section

This commit is contained in:
Asif Bacchus 2019-01-04 22:50:24 -07:00
parent 70baf37abc
commit b0db9bee5d

View File

@ -111,10 +111,52 @@ if [ "${useCertbot}" -eq 1 ]; then
done done
fi fi
# not using Certbot: get location of certificate
while true; do
read -p "What is the path to your primary SSL certificate? " inputCertPath
case $inputCertPath in
'')
echo -e "\n${err}You cannot have an empty path to your SSL certificate${norm}"
;;
[Xx]*)
echo -e "\n${cyan}---exiting---\n${norm}"
exit 1
;;
*)
# validate path
if [ -s "${inputCertPath}" ]; then
CertPath="${inputCertPath}"
break
else
echo -e "\n${warn}The file you specified doesn't exist or is empty"
while true; do
read -p "Do you want to use this path anyways? " yn
echo -e "${norm}"
case $yn in
[Yy]*)
CertPath="${inputCertPath}"
break
;;
[Nn]*)
break
;;
*)
;;
esac
done
if [ -n "${CertPath}" ]; then
break
fi
fi
;;
esac
done
# debug section # debug section
echo "Local IP4: $IP4" echo "Local IP4: $IP4"
echo "Using Certbot: $useCertbot" echo "Using Certbot: $useCertbot"
echo "CertbotDomain: $CertbotDomain" echo "CertbotDomain: $CertbotDomain"
echo "CertPath: $CertPath"
exit 0 exit 0