added private key path section
This commit is contained in:
parent
b0db9bee5d
commit
7a6c6a9ac4
18
.vscode/numbered-bookmarks.json
vendored
18
.vscode/numbered-bookmarks.json
vendored
@ -1,3 +1,19 @@
|
|||||||
{
|
{
|
||||||
"bookmarks": []
|
"bookmarks": [
|
||||||
|
{
|
||||||
|
"fsPath": "$ROOTPATH$/setup.sh",
|
||||||
|
"bookmarks": [
|
||||||
|
-1,
|
||||||
|
17,
|
||||||
|
-1,
|
||||||
|
-1,
|
||||||
|
-1,
|
||||||
|
-1,
|
||||||
|
-1,
|
||||||
|
-1,
|
||||||
|
-1,
|
||||||
|
-1
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
43
setup.sh
43
setup.sh
@ -21,6 +21,7 @@ unset IP4
|
|||||||
unset useCertbot
|
unset useCertbot
|
||||||
unset CertbotDomain
|
unset CertbotDomain
|
||||||
unset CertPath
|
unset CertPath
|
||||||
|
unset KeyPath
|
||||||
|
|
||||||
detectedIP=$(ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p')
|
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])"
|
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
|
esac
|
||||||
done
|
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
|
# 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"
|
echo "CertPath: $CertPath"
|
||||||
|
echo "KeyPath: $KeyPath"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user