mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-01 18:19:55 +00:00
add find_binary()
* emulates `which` as centos does not have it by default
This commit is contained in:
parent
afcd2a35ab
commit
d3a5f408c7
1 changed files with 13 additions and 0 deletions
|
@ -119,6 +119,19 @@ check_dirs() {
|
|||
done
|
||||
}
|
||||
|
||||
find_binary() {
|
||||
local x= path= bin=$1 bin_paths='/usr/bin /usr/local/bin /usr/sbin /usr/local/sbin /root/bin /root/.bin'
|
||||
|
||||
for x in $bin_paths; do
|
||||
path="$x/$bin"
|
||||
|
||||
if [ -x $path ]; then
|
||||
echo $path
|
||||
return
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
update_paths() {
|
||||
# variables in nginx include files not currently possible
|
||||
# updates hard coded bots.d path in globalblacklist.conf
|
||||
|
|
Loading…
Add table
Reference in a new issue