fixed code indent problem

This commit is contained in:
Asif Bacchus 2019-01-08 02:00:53 -07:00
parent 02489e6813
commit 40595027fe

148
setup.sh
View File

@ -453,85 +453,85 @@ fi
# dhparam: get location of DH Parameters file # dhparam: get location of DH Parameters file
if [ "${useSSL}" -eq 1 ]; then if [ "${useSSL}" -eq 1 ]; then
echo -e "\n${mag}Having your own unique Diffie-Hellman Parameters file makes your SSL" echo -e "\n${mag}Having your own unique Diffie-Hellman Parameters file makes your SSL"
echo "communication more secure by pre-generating safe large prime and generator" echo "communication more secure by pre-generating safe large prime and generator"
echo "numbers. You shouldn't use any pre-installed dhparam.pem files. You should" echo "numbers. You shouldn't use any pre-installed dhparam.pem files. You should"
echo "always generate your own." echo "always generate your own."
echo -e "\nIf you haven't done that already and would like this script to do it for" echo -e "\nIf you haven't done that already and would like this script to do it for"
echo -e "you, please type ${warn}generate${mag} at the prompt instead of a path." echo -e "you, please type ${warn}generate${mag} at the prompt instead of a path."
echo "Please note that although this process uses DSA-primes to speed things up" echo "Please note that although this process uses DSA-primes to speed things up"
echo "without sacrificing security, the process may still take up to 20+ minutes" echo "without sacrificing security, the process may still take up to 20+ minutes"
echo -e "depending on your hardware.${norm}\n" echo -e "depending on your hardware.${norm}\n"
while true; do while true; do
read -p "What is the path to your DH Parameters file? (default: /etc/ssl/certs/dhparam.pem) " inputDHPath read -p "What is the path to your DH Parameters file? (default: /etc/ssl/certs/dhparam.pem) " inputDHPath
case "${inputDHPath}" in case "${inputDHPath}" in
'') '')
# verify default path exists # verify default path exists
inputDHPath="/etc/ssl/certs/dhparam.pem" inputDHPath="/etc/ssl/certs/dhparam.pem"
if [ -f "${inputDHPath}" ]; then if [ -f "${inputDHPath}" ]; then
DHPath="${inputDHPath}" DHPath="${inputDHPath}"
break
else
echo -e "\n${warn}The file you specified doesn't exist${norm}"
while true; do
read -p "Do you want to use this path anyways? " yn
case $yn in
[Yy]*)
DHPath="${inputDHPath}"
break
;;
[Nn]*)
break
;;
*)
;;
esac
done
if [ -n "${DHPath}" ]; then
break break
else
echo -e "\n${warn}The file you specified doesn't exist${norm}"
while true; do
read -p "Do you want to use this path anyways? " yn
case $yn in
[Yy]*)
DHPath="${inputDHPath}"
break
;;
[Nn]*)
break
;;
*)
;;
esac
done
if [ -n "${DHPath}" ]; then
break
fi
fi fi
fi ;;
;; [Xx]*)
[Xx]*) echo -e "\n${cyan}---exiting---\n${norm}"
echo -e "\n${cyan}---exiting---\n${norm}" exit 1
exit 1 ;;
;; [Gg][Ee][Nn][Ee][Rr][Aa][Tt][Ee]*)
[Gg][Ee][Nn][Ee][Rr][Aa][Tt][Ee]*) generateDH=1
generateDH=1
break
;;
/*)
# validate path
if [ -f "${inputDHPath}" ]; then
DHPath="${inputDHPath}"
break break
else ;;
echo -e "\n${warn}The file you specified doesn't exist${norm}" /*)
while true; do # validate path
read -p "Do you want to use this path anyways? " yn if [ -f "${inputDHPath}" ]; then
case $yn in DHPath="${inputDHPath}"
[Yy]*)
DHPath="${inputDHPath}"
break
;;
[Nn]*)
break
;;
*)
;;
esac
done
if [ -n "${DHPath}" ]; then
break break
else
echo -e "\n${warn}The file you specified doesn't exist${norm}"
while true; do
read -p "Do you want to use this path anyways? " yn
case $yn in
[Yy]*)
DHPath="${inputDHPath}"
break
;;
[Nn]*)
break
;;
*)
;;
esac
done
if [ -n "${DHPath}" ]; then
break
fi
fi fi
fi ;;
;; *)
*) # path must be absolute and start with a slash
# path must be absolute and start with a slash echo -e "\n${err}Path must be absolute not relative. Please re-enter starting with '/'${norm}"
echo -e "\n${err}Path must be absolute not relative. Please re-enter starting with '/'${norm}" ;;
;; esac
esac done
done
fi fi