install-ngxblocker: add check_depends()

centos 7 does not have wget by default so check depends.
This commit is contained in:
Stuart Cardall 2017-06-07 17:11:15 +00:00
parent e6af6d7fb6
commit 13a4fbb0d7
No known key found for this signature in database
GPG key ID: AEB857F1C891D0C6

View file

@ -208,6 +208,14 @@ wget_opts() {
echo $opts
}
check_depends() {
# centos does not have wget installed by default
if ! wget --help >/dev/null 2>&1; then
printf "$0 requires: wget \n"
exit 1
fi
}
check_online() {
local url=$1 options=$(wget_opts)
@ -225,6 +233,8 @@ main() {
exit 1
fi
check_depends
# parse command line
get_options $@
include_url=$REPO/include_filelist.txt
@ -270,4 +280,3 @@ exit $?
# PLEASE ALSO SEE THE SETUP SCRIPT TO INSERT THE NECESSARY INCLUDES FOR YOU
### You can now use a setup script contributed by Stuart Cardall to automatically add the includes for you
### See - https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/setup-ngxblocker