diff --git a/setup/common.sh b/setup/common.sh index 471ac7e..ac19c3b 100755 --- a/setup/common.sh +++ b/setup/common.sh @@ -269,6 +269,15 @@ function ensure_file_exists { fi } +function ensure_file_missing { + local -r FILE="${1}" + + if [[ -f "${FILE}" ]]; then + log_error "File ${FILE} already exists." + exit 1 + fi +} + function windows_env_value { local -r VAR="${1}" local value="$(/mnt/c/Windows/System32/cmd.exe /C "echo %${VAR}%")" diff --git a/setup/resources/apache/make-site.sh b/setup/resources/apache/make-site.sh index 093afee..4e151a9 100755 --- a/setup/resources/apache/make-site.sh +++ b/setup/resources/apache/make-site.sh @@ -29,6 +29,7 @@ fi ensure_root ensure_installed "Apache" ensure_file_exists "${STUB_FILE}" +ensure_file_missing "${NEW_SITE_CONFIG}" log_info "Setting up new site config file."