Merge pull request #348 from itoffshore/alpine

add warning for missing dig binary
This commit is contained in:
Stuart Cardall 2020-02-06 21:42:11 +00:00 committed by GitHub
commit 77cad1c970
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"