add find_binary()

* emulates `which` as centos does not have it by default
This commit is contained in:
Stuart Cardall 2018-10-08 18:34:02 +00:00
parent afcd2a35ab
commit d3a5f408c7
No known key found for this signature in database
GPG key ID: AEB857F1C891D0C6

View file

@ -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