mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-03 19:20:16 +00:00
setup-ngxblocker: add check_depends()
This commit is contained in:
parent
7872f3bed5
commit
0618eb0909
1 changed files with 22 additions and 0 deletions
|
@ -251,6 +251,26 @@ check_args() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_depends() {
|
||||||
|
# centos does not have wget installed by default
|
||||||
|
if ! wget --help >/dev/null 2>&1; then
|
||||||
|
printf "${BOLDRED}ERROR${RESET}: $0 requires: 'wget' => ${BOLDWHITE}cannot download files.${RESET}\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# centos also does not have which by default
|
||||||
|
if [ ! -x /usr/bin/curl ]; then
|
||||||
|
printf "${BOLDRED}ERROR${RESET}: $0 requires: 'curl' => ${BOLDWHITE}cannot check remote version.${RESET}\n"
|
||||||
|
exit 1
|
||||||
|
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"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
get_options() {
|
get_options() {
|
||||||
local arg= opts=
|
local arg= opts=
|
||||||
|
|
||||||
|
@ -315,6 +335,8 @@ main() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
check_depends
|
||||||
|
|
||||||
# parse command line
|
# parse command line
|
||||||
get_options $@
|
get_options $@
|
||||||
include_url=$REPO/include_filelist.txt
|
include_url=$REPO/include_filelist.txt
|
||||||
|
|
Loading…
Add table
Reference in a new issue