Skip to content

Commit

Permalink
🍱 Update file assets/download.sh.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADD-SP committed Jul 17, 2021
1 parent f6785e7 commit 45c2999
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions assets/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,29 @@ echo 'yes'

echo -n "checking for libc implementation ... "

imp=''

tmp=`find -L /lib* -regex \.*libc\.so.*` 2> /dev/null

echo "$tmp" | grep gnu > /dev/null
if [ $? -eq 0 ] ; then
echo 'yes'
imp='glibc'
echo ' + GNU C libary'
else
echo "$tmp" | grep musl > /dev/null
if [ $? -eq 0 ] ; then
echo 'yes'
imp='musl'
echo ' + musl C libary'
else
echo 'no'
exit 2
fi
fi

echo -n "pulling remote image addsp/ngx_waf-prebuild:ngx-$1-module-$2 ... "
tmp=`docker pull "addsp/ngx_waf-prebuild:ngx-$1-module-$2"` 2> /dev/null
echo -n "pulling remote image addsp/ngx_waf-prebuild:ngx-$1-module-$2-$tmp ... "
tmp=`docker pull "addsp/ngx_waf-prebuild:ngx-$1-module-$2-$tmp"` 2> /dev/null
if [ $? -ne 0 ] ; then
echo 'no'
exit 121
Expand All @@ -70,7 +74,7 @@ do
tmpdir=`head -10 /dev/urandom | md5sum - | cut -c 1-32`
done

tmp=`docker run --rm -d -v "$(pwd)/$tmpdir":/out "addsp/ngx_waf-prebuild:ngx-$1-module-$2" cp /modules/ngx_http_waf_module.so /out` 2> /dev/null
tmp=`docker run --rm -d -v "$(pwd)/$tmpdir":/out "addsp/ngx_waf-prebuild:ngx-$1-module-$2-$tmp" cp /modules/ngx_http_waf_module.so /out` 2> /dev/null

cp "$(pwd)/$tmpdir/ngx_http_waf_module.so" ./
rm -rf "$(pwd)/$tmpdir"

0 comments on commit 45c2999

Please sign in to comment.