From 13a4fbb0d7acb5d4bf2a8d732e1b9c7b59e01ed8 Mon Sep 17 00:00:00 2001 From: Stuart Cardall Date: Wed, 7 Jun 2017 17:11:15 +0000 Subject: [PATCH] install-ngxblocker: add check_depends() centos 7 does not have wget by default so check depends. --- install-ngxblocker | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/install-ngxblocker b/install-ngxblocker index 55c12d5d5..618c182cc 100755 --- a/install-ngxblocker +++ b/install-ngxblocker @@ -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 -