added private key path section

This commit is contained in:
Asif Bacchus 2019-01-04 22:56:24 -07:00
parent b0db9bee5d
commit 7a6c6a9ac4
2 changed files with 60 additions and 1 deletions

View File

@ -1,3 +1,19 @@
{
"bookmarks": []
"bookmarks": [
{
"fsPath": "$ROOTPATH$/setup.sh",
"bookmarks": [
-1,
17,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1
]
}
]
}

View File

@ -21,6 +21,7 @@ unset IP4
unset useCertbot
unset CertbotDomain
unset CertPath
unset KeyPath
detectedIP=$(ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p')
regexIP4="(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])"
@ -152,11 +153,53 @@ while true; do
esac
done
# not using Certbot: get location of private key
while true; do
read -p "What is the path to your primary SSL private key? " inputKeyPath
case "${inputKeyPath}" in
'')
echo -e "\n${err}You cannot have an empty path to your SSL private key${norm}"
;;
[Xx]*)
echo -e "\n${cyan}---exiting---\n${norm}"
exit 1
;;
*)
# validate path
if [ -f "${inputKeyPath}" ]; then
KeyPath="${inputKeyPath}"
break
else
echo -e "\n${warn}The file you specified doesn't exist"
while true; do
read -p "Do you want to use this path anyways? " yn
echo -e "${norm}"
case $yn in
[Yy]*)
KeyPath="${inputKeyPath}"
break
;;
[Nn]*)
break
;;
*)
;;
esac
done
if [ -n "${KeyPath}" ]; then
break
fi
fi
;;
esac
done
# debug section
echo "Local IP4: $IP4"
echo "Using Certbot: $useCertbot"
echo "CertbotDomain: $CertbotDomain"
echo "CertPath: $CertPath"
echo "KeyPath: $KeyPath"
exit 0