#!/bin/bash java -version > /dev/null if [ $? -ne 0 ];then rpm -ivh jdk-8u131-linux-x64_.rpm tar -zxvf apache-tomcat-8.5.35.tar.gz netstat -ntlp |grep 8080 > /dev/null if [ $? -ne 0 ];then cd apache-tomcat-8.5.35/bin/ ./startup.sh fi else systemctl stop firewalld setenforce 0 fi