From c31b908c4bc897d65cebaf8ae4c01d0dd1db5d4a Mon Sep 17 00:00:00 2001 From: Stuart Cardall Date: Thu, 27 Apr 2017 14:00:11 +0000 Subject: [PATCH] fix POSIX shell compatibility fixes https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/issues/39 --- install-ngxblocker | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install-ngxblocker b/install-ngxblocker index aaf13677a..4762eef6a 100755 --- a/install-ngxblocker +++ b/install-ngxblocker @@ -91,7 +91,7 @@ check_if_updating() { download_files() { local url= x= local_file= remote_dir=$1 local_dir=$2 - local file_list=$(echo $@ | awk '{$1="",$2=""; print}') + local file_list=$(echo $@ | awk '{$1=$2=""; print $0}') local col_size=$(( $(longest_str $file_list) + $(echo $remote_dir | wc -m) )) if [ -n "$(check_if_updating $local_dir $file_list)" ]; then @@ -234,7 +234,8 @@ main() { if [ -n "$(check_online $include_url)" ]; then local tmp=$(mktemp) wget -q $include_url -O $tmp - source $tmp 2>/dev/null + # use period not source in POSIX shell + . $tmp 2>/dev/null rm -f $tmp else printf "Repo down or missing: $include_url\n"