title: In linux how to find tomcat server is running in multple port in different systems without mentioning portnumber
body: <p>read INPUT_STRING
    case $INPUT_STRING in</p>
  
  <pre><code>stop)
  
      check=`netstat -na | grep 8080 | awk '{print $6}'|head -1`
      if [ "$check" = "TIME_WAIT" ]; then
          echo "DEFAULT TOMCAT PORT IS LISTENING, SO ITS stopped already..."
      else 
          sh /opt/apache-tomcat-8.0.39/bin/shutdown.sh &gt; /dev/null 2&gt;&amp;1
      echo "Tomcat server is stopped....."
  
      fi
  </code></pre>
  
  <p>Here My code is finding tomcat server running on 8080 port only so that it is easily find whether the tomcat is running or not. But What actually i need is to stop/start the tomcat server if it is running or stoped status in some other ports.....</p>