mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-02 02:29:58 +00:00
add warning for missing dig binary
* skip whitelisting public ip if dig binary is unavailable * fixes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/346
This commit is contained in:
parent
7b6ad028f7
commit
13ad4132f9
1 changed files with 9 additions and 0 deletions
|
@ -116,6 +116,10 @@ whitelist_ips() {
|
||||||
|
|
||||||
mkdir -p $BOTS_DIR
|
mkdir -p $BOTS_DIR
|
||||||
|
|
||||||
|
if [ -z $(find_binary dig) ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
ip="$(dig +short myip.opendns.com @resolver1.opendns.com)"
|
ip="$(dig +short myip.opendns.com @resolver1.opendns.com)"
|
||||||
if ! grep "$ip" $conf >/dev/null 2>&1; then
|
if ! grep "$ip" $conf >/dev/null 2>&1; then
|
||||||
printf "\n%-17s %-15s %-s\n" "Whitelisting ip:" "$ip" "=> $conf"
|
printf "\n%-17s %-15s %-s\n" "Whitelisting ip:" "$ip" "=> $conf"
|
||||||
|
@ -306,6 +310,11 @@ check_depends() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# required for whitelisting public ip
|
||||||
|
if [ -z $(find_binary dig) ]; then
|
||||||
|
printf "${BOLDYELLOW}WARN${RESET}: $0 optionally requires: 'dig' => ${BOLDWHITE}cannot whitelist public ip address.${RESET}\n"
|
||||||
|
fi
|
||||||
|
|
||||||
# install-ngxblocker downloads missing scripts / includes as part of the update process
|
# install-ngxblocker downloads missing scripts / includes as part of the update process
|
||||||
if [ ! -x $INSTALLER ]; then
|
if [ ! -x $INSTALLER ]; then
|
||||||
printf "${BOLDRED}ERROR${RESET}: $0 requires: '$INSTALLER' => ${BOLDWHITE}cannot update includes.${RESET}\n"
|
printf "${BOLDRED}ERROR${RESET}: $0 requires: '$INSTALLER' => ${BOLDWHITE}cannot update includes.${RESET}\n"
|
||||||
|
|
Loading…
Add table
Reference in a new issue