diff --git a/CONFIG.sh b/CONFIG.sh index 38cbef0..dda2617 100644 --- a/CONFIG.sh +++ b/CONFIG.sh @@ -4,4 +4,8 @@ sudo systemctl stop firewalld sudo systemctl disable firewalld sudo systemctl mask firewalld sudo systemctl enable iptables -sudo iptables -F \ No newline at end of file +sudo iptables -F + +function instalar() { + yum list installed "$1" &>/dev/null && echo "$1 já instalado" || sudo yum install -y "$1" +} diff --git a/FIREWALL.sh b/FIREWALL.sh index a1f5f76..a71a782 100644 --- a/FIREWALL.sh +++ b/FIREWALL.sh @@ -9,10 +9,6 @@ sudo ifconfig enp0s8 $IP_EXTERNAL netmask 255.255.255.0 sudo ifconfig enp0s9 $IP_INTERNAL netmask 255.255.255.0 # instalar mod security e apache -function instalar() { - yum list installed "$1" &>/dev/null && return || sudo yum install -y "$1" -} - instalar epel_release instalar httpd instalar mod_security diff --git a/WEB_SERVER.sh b/WEB_SERVER.sh index 2a2da74..e3008a5 100644 --- a/WEB_SERVER.sh +++ b/WEB_SERVER.sh @@ -7,16 +7,19 @@ IP="10.60.0.2" sudo ifconfig enp0s8 $IP netmask 255.255.255.0 sudo route add default gw 10.60.0.1 -# instalar node -yum list installed nodejs &>/dev/null && echo "Node already installed..." || sudo yum install -y nodejs +# instalar packages +instalar nodejs # instalar juice-shop se nao existir -if [[ ! -d $HOME/juice-shop ]]; then +jspath="/var/juice-shop" +if [[ ! -d "$jspath" ]]; then + mkdir "$jspath" curl -o js.tar.gz "https://github.com/juice-shop/juice-shop/releases/download/v20.0.0/juice-shop-20.0.0_node24_linux_x64.tgz" - tar -xzvf js.tar.gz $HOME/juice-shop + tar -xzvf js.tar.gz "$jspath" + rm js.tar.gz + cd "$jspath" + npm i fi # correr juice shop via npm -cd $HOME/juice-shop -npm install npm start