diff --git a/setup-ngxblocker b/setup-ngxblocker index ab2c16dab..115155e10 100755 --- a/setup-ngxblocker +++ b/setup-ngxblocker @@ -116,6 +116,10 @@ whitelist_ips() { mkdir -p $BOTS_DIR + if [ -z $(find_binary dig) ]; then + return + fi + ip="$(dig +short myip.opendns.com @resolver1.opendns.com)" if ! grep "$ip" $conf >/dev/null 2>&1; then printf "\n%-17s %-15s %-s\n" "Whitelisting ip:" "$ip" "=> $conf" @@ -306,6 +310,11 @@ check_depends() { exit 1 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 if [ ! -x $INSTALLER ]; then printf "${BOLDRED}ERROR${RESET}: $0 requires: '$INSTALLER' => ${BOLDWHITE}cannot update includes.${RESET}\n"