mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-02 10:40:36 +00:00
check vhosts before testing connectivity
* check the repo is online after configuration checks
This commit is contained in:
parent
d1e8be6945
commit
0187170776
1 changed files with 8 additions and 6 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue