check webroot and config dirs

This commit is contained in:
Asif Bacchus 2019-10-17 18:23:07 -06:00
parent fa41187f9b
commit 8f781de0d4
1 changed files with 14 additions and 0 deletions

View File

@ -15,6 +15,8 @@ yellow=$(tput setaf 3)
### parameter defaults
container_name="ab-nginx"
shell=false
unset CONFIG_DIR
unset WEBROOT_DIR
scriptHelp () {
@ -93,7 +95,19 @@ if [ "$TLS13_ONLY" = FALSE ]; then
fi
fi
# check if specified config directory exists
if [ "$CONFIG_DIR" ] && [ ! -d "$CONFIG_DIR" ]; then
printf "${err}\nCannot find specified configuration file directory. Exiting.${norm}\n"
exit 4
fi
# check if specified webroot directory exists
if [ "$WEBROOT_DIR" ] && [ ! -d "$WEBROOT_DIR" ]; then
printf "${err}\nCannot find specified webroot directory. Exiting.${norm}\n"
exit 4
fi
exit 99
# process startup parameters
while [ $# -gt 0 ]; do
case "$1" in