added check for absolute path to supplied paths

This commit is contained in:
Asif Bacchus 2019-01-08 01:59:45 -07:00
parent 746144e40a
commit 02489e6813
2 changed files with 21 additions and 5 deletions

View File

@ -6,7 +6,7 @@
-1, -1,
19, 19,
54, 54,
758, 774,
68, 68,
-1, -1,
-1, -1,

View File

@ -320,7 +320,7 @@ if [ "${useSSL}" -eq 1 ] && [ "${useCertbot}" -eq 0 ]; then
echo -e "\n${cyan}---exiting---\n${norm}" echo -e "\n${cyan}---exiting---\n${norm}"
exit 1 exit 1
;; ;;
*) /*)
# validate path # validate path
if [ -f "${inputCertPath}" ]; then if [ -f "${inputCertPath}" ]; then
CertPath="${inputCertPath}" CertPath="${inputCertPath}"
@ -346,6 +346,10 @@ if [ "${useSSL}" -eq 1 ] && [ "${useCertbot}" -eq 0 ]; then
fi fi
fi fi
;; ;;
*)
# 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}"
;;
esac esac
done done
@ -360,7 +364,7 @@ if [ "${useSSL}" -eq 1 ] && [ "${useCertbot}" -eq 0 ]; then
echo -e "\n${cyan}---exiting---\n${norm}" echo -e "\n${cyan}---exiting---\n${norm}"
exit 1 exit 1
;; ;;
*) /*)
# validate path # validate path
if [ -f "${inputKeyPath}" ]; then if [ -f "${inputKeyPath}" ]; then
KeyPath="${inputKeyPath}" KeyPath="${inputKeyPath}"
@ -386,6 +390,10 @@ if [ "${useSSL}" -eq 1 ] && [ "${useCertbot}" -eq 0 ]; then
fi fi
fi fi
;; ;;
*)
# 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}"
;;
esac esac
done done
@ -409,7 +417,7 @@ if [ "${useSSL}" -eq 1 ] && [ "${useCertbot}" -eq 0 ]; then
echo -e "\n${cyan}---exiting---\n${norm}" echo -e "\n${cyan}---exiting---\n${norm}"
exit 1 exit 1
;; ;;
*) /*)
# validate path # validate path
if [ -f "${inputCAChainPath}" ]; then if [ -f "${inputCAChainPath}" ]; then
CAChainPath="${inputCAChainPath}" CAChainPath="${inputCAChainPath}"
@ -435,6 +443,10 @@ if [ "${useSSL}" -eq 1 ] && [ "${useCertbot}" -eq 0 ]; then
fi fi
fi fi
;; ;;
*)
# 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}"
;;
esac esac
done done
fi fi
@ -488,7 +500,7 @@ while true; do
generateDH=1 generateDH=1
break break
;; ;;
*) /*)
# validate path # validate path
if [ -f "${inputDHPath}" ]; then if [ -f "${inputDHPath}" ]; then
DHPath="${inputDHPath}" DHPath="${inputDHPath}"
@ -514,6 +526,10 @@ while true; do
fi fi
fi fi
;; ;;
*)
# 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}"
;;
esac esac
done done
fi fi