mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-01 18:19:55 +00:00
remove hard coded paths
* use find_binary() instead of hard coded paths
This commit is contained in:
parent
2ffc8bcfcf
commit
8b5af8b7fa
1 changed files with 3 additions and 3 deletions
|
@ -120,7 +120,7 @@ check_dirs() {
|
|||
}
|
||||
|
||||
find_binary() {
|
||||
local x= path= bin=$1 bin_paths='/usr/bin /usr/local/bin /usr/sbin /usr/local/sbin /root/bin /root/.bin'
|
||||
local x= path= bin=$1 bin_paths='/bin /usr/bin /usr/local/bin /usr/sbin /usr/local/sbin /root/bin /root/.bin'
|
||||
|
||||
for x in $bin_paths; do
|
||||
path="$x/$bin"
|
||||
|
@ -221,7 +221,7 @@ check_args() {
|
|||
}
|
||||
|
||||
check_mail_depends() {
|
||||
if [ ! -f /usr/bin/mail ] && [ ! -f /bin/mail ]; then # mailx + ssmtp are enough to send emails
|
||||
if [ -z $(find_binary mail) ]; then # mailx + ssmtp are enough to send emails
|
||||
printf "${BOLDYELLOW}WARN${RESET}: missing mail command => ${BOLDWHITE}disabling emails${RESET}.\n\n"
|
||||
return 1
|
||||
fi
|
||||
|
@ -229,7 +229,7 @@ check_mail_depends() {
|
|||
|
||||
check_depends() {
|
||||
# centos does not have which by default
|
||||
if [ ! -x /usr/bin/curl ]; then
|
||||
if [ -z $(find_binary curl) ]; then
|
||||
printf "${BOLDRED}ERROR${RESET}: $0 requires: 'curl' => ${BOLDWHITE}cannot check remote version.${RESET}\n"
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue