linux - fixed debian/ubuntu but still some work needed on centos
This commit is contained in:
parent
98568a57c9
commit
37f5e4ed71
@ -532,11 +532,13 @@ echo "./configure $CONFARGS --add-dynamic-module=/tmp/bunkerized-nginx/ModSecuri
|
|||||||
do_and_check_cmd chmod +x "/tmp/bunkerized-nginx/nginx-${NGINX_VERSION}/configure-fix.sh"
|
do_and_check_cmd chmod +x "/tmp/bunkerized-nginx/nginx-${NGINX_VERSION}/configure-fix.sh"
|
||||||
CHANGE_DIR="/tmp/bunkerized-nginx/nginx-${NGINX_VERSION}" LUAJIT_LIB="/usr/local/lib/" LUAJIT_INC="/usr/local/include/luajit-2.1" do_and_check_cmd ./configure-fix.sh
|
CHANGE_DIR="/tmp/bunkerized-nginx/nginx-${NGINX_VERSION}" LUAJIT_LIB="/usr/local/lib/" LUAJIT_INC="/usr/local/include/luajit-2.1" do_and_check_cmd ./configure-fix.sh
|
||||||
CHANGE_DIR="/tmp/bunkerized-nginx/nginx-${NGINX_VERSION}" do_and_check_cmd make -j $NTASK modules
|
CHANGE_DIR="/tmp/bunkerized-nginx/nginx-${NGINX_VERSION}" do_and_check_cmd make -j $NTASK modules
|
||||||
if [ "$OS" = "centos" ] ; then
|
if [ ! -d "/usr/lib/nginx/modules" ] ; then
|
||||||
CHANGE_DIR="/tmp/bunkerized-nginx/nginx-${NGINX_VERSION}" do_and_check_cmd cp ./objs/*.so /usr/lib64/nginx/modules
|
do_and_check_cmd mkdir -p /usr/lib/nginx/modules
|
||||||
else
|
|
||||||
CHANGE_DIR="/tmp/bunkerized-nginx/nginx-${NGINX_VERSION}" do_and_check_cmd cp ./objs/*.so /usr/lib/nginx/modules
|
|
||||||
fi
|
fi
|
||||||
|
do_and_check_cmd chown -R root:root /usr/lib/nginx
|
||||||
|
do_and_check_cmd chmod -R 755 /usr/lib/nginx
|
||||||
|
CHANGE_DIR="/tmp/bunkerized-nginx/nginx-${NGINX_VERSION}" do_and_check_cmd cp ./objs/*.so /usr/lib/nginx/modules
|
||||||
|
do_and_check_cmd chmod 744 /usr/lib/nginx/modules/*
|
||||||
|
|
||||||
# We're done
|
# We're done
|
||||||
if [ "$OS" = "alpine" ] ; then
|
if [ "$OS" = "alpine" ] ; then
|
||||||
|
|||||||
@ -83,11 +83,11 @@ if [ "$OS" = "debian" ] || [ "$OS" = "ubuntu" ] ; then
|
|||||||
fi
|
fi
|
||||||
echo "[*] Install dependencies"
|
echo "[*] Install dependencies"
|
||||||
if [ "$OS" = "debian" ] || [ "$OS" = "ubuntu" ] ; then
|
if [ "$OS" = "debian" ] || [ "$OS" = "ubuntu" ] ; then
|
||||||
DEBIAN_DEPS="git cron curl python3 python3-pip"
|
DEBIAN_DEPS="git cron curl python3 python3-pip procps"
|
||||||
DEBIAN_FRONTEND=noninteractive do_and_check_cmd apt install -y $DEBIAN_DEPS
|
DEBIAN_FRONTEND=noninteractive do_and_check_cmd apt install -y $DEBIAN_DEPS
|
||||||
elif [ "$OS" = "centos" ] ; then
|
elif [ "$OS" = "centos" ] ; then
|
||||||
do_and_check_cmd yum install -y epel-release
|
do_and_check_cmd yum install -y epel-release
|
||||||
CENTOS_DEPS="git crontabs curl python3 python3-pip"
|
CENTOS_DEPS="git crontabs curl python3 python3-pip procps luajit lua"
|
||||||
do_and_check_cmd yum install -y $CENTOS_DEPS
|
do_and_check_cmd yum install -y $CENTOS_DEPS
|
||||||
fi
|
fi
|
||||||
do_and_check_cmd pip3 install jinja2
|
do_and_check_cmd pip3 install jinja2
|
||||||
|
|||||||
@ -72,16 +72,18 @@ fi
|
|||||||
|
|
||||||
echo "[*] Exec bunkerized-nginx"
|
echo "[*] Exec bunkerized-nginx"
|
||||||
docker exec "$id" bunkerized-nginx
|
docker exec "$id" bunkerized-nginx
|
||||||
if [ $? -ne 0 ] || [ "$res" != "ok" ] ; then
|
if [ $? -ne 0 ] ; then
|
||||||
echo "[!] docker exec failed"
|
echo "[!] docker exec failed"
|
||||||
cleanup "$id"
|
cleanup "$id"
|
||||||
exit 9
|
exit 9
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[*] Exec curl"
|
echo "[*] Exec curl"
|
||||||
res="$(curl -s -H "User-Agent: LegitOne" http://localhost/")
|
res="$(curl -s -H "User-Agent: LegitOne" http://localhost/)"
|
||||||
if [ $? -ne 0 ] || [ "$res" != "ok" ] ; then
|
if [ $? -ne 0 ] || [ "$res" != "ok" ] ; then
|
||||||
echo "[!] curl failed"
|
echo "[!] curl failed"
|
||||||
cleanup "$id"
|
cleanup "$id"
|
||||||
exit 10
|
exit 10
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cleanup "$id"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user