check vhosts before testing connectivity

* check the repo is online after configuration checks
This commit is contained in:
Stuart Cardall 2018-02-26 21:57:04 +00:00
parent d1e8be6945
commit 0187170776
No known key found for this signature in database
GPG key ID: AEB857F1C891D0C6

View file

@ -344,9 +344,13 @@ main() {
get_options $@ get_options $@
check_depends check_depends
include_url=$REPO/include_filelist.txt # check vhosts
file_list=$(find_vhosts)
check_config $file_list
# check repo is online & source includes # check repo is online & source includes
include_url=$REPO/include_filelist.txt
printf "Checking url: $include_url\n" printf "Checking url: $include_url\n"
if [ -n "$(check_online $include_url)" ]; then if [ -n "$(check_online $include_url)" ]; then
local tmp=$(mktemp) local tmp=$(mktemp)
@ -370,11 +374,6 @@ main() {
n*|N*) VHOST_INCLUDES=$(echo $VHOST_INCLUDES | sed 's|ddos.conf||');; n*|N*) VHOST_INCLUDES=$(echo $VHOST_INCLUDES | sed 's|ddos.conf||');;
esac esac
# gather vhosts
file_list=$(find_vhosts)
check_config $file_list
col_size=$(( $(longest_str $CONF_FILES) + $(echo $CONF_DIR | wc -m) + 10 ))
# by default do not change any files # by default do not change any files
if [ -z "$DRY_RUN" ]; then if [ -z "$DRY_RUN" ]; then
printf "\n** Dry Run ** | not updating files | run as '$(basename $0) -x' to setup files.\n\n" printf "\n** Dry Run ** | not updating files | run as '$(basename $0) -x' to setup files.\n\n"
@ -382,6 +381,9 @@ main() {
printf "\n" printf "\n"
fi fi
# calculate column size for better message printing
col_size=$(( $(longest_str $CONF_FILES) + $(echo $CONF_DIR | wc -m) + 10 ))
# update main config # update main config
line=$(find_includes $MAIN_CONF include last http first '\}' last ) line=$(find_includes $MAIN_CONF include last http first '\}' last )
if [ -n "$(check_wildcard $MAIN_CONF $CONF_DIR)" ]; then # also recalculate column width if [ -n "$(check_wildcard $MAIN_CONF $CONF_DIR)" ]; then # also recalculate column width