From 1541154f02ae12b9cafbecd9dd9cd60255487c9b Mon Sep 17 00:00:00 2001 From: Stuart Cardall Date: Tue, 28 Jan 2020 12:43:07 +0000 Subject: [PATCH] workaround for crontabs configured without $PATH fixes: https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/284 --- update-ngxblocker | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/update-ngxblocker b/update-ngxblocker index 9ace99938..1120dac9c 100755 --- a/update-ngxblocker +++ b/update-ngxblocker @@ -313,6 +313,7 @@ main() { local REPO=https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master local file=globalblacklist.conf remote_dir=conf.d url= output= update= status= tmp= retval= local nginx_path=$(find_binary nginx) + local pidof_path=$(find_binary pidof) # require root if [ "$(id -u)" != "0" ]; then @@ -358,7 +359,8 @@ main() { # re-read nginx configuration if [ $retval = 0 ]; then - if pidof nginx 1>/dev/null; then + # use full paths to workaround crontabs without $PATH configured + if $pidof_path nginx 1>/dev/null; then $nginx_path -s reload 2>&1 >/dev/null