troubleshooting Question

Windows script to Bash conversion

Avatar of atorex
atorex asked on
LinuxShell Scripting
3 Comments1 Solution553 ViewsLast Modified:
I'm convering a Windows sceript in to bash, due to my limitations in bash scripting I need some help in converting the following. the below is checking if Tomcat Web server is running and if not wayting till it is, I could do netstat and grep port 8080 but cant get the rest of the loop.

this is the windows script

  :: Test to see if WebServer is running before starting PA.
  :startWebServerStat
  netstat -na | find "0.0.0.0:8080" > WebServerStat.out

  set WebServerStat=
  for /f %%e in (WebServerStat.out) do set WebServerStat=%%e
  del /q/f WebServerStat.out

  if not defined WebServerStat (
    echo.
    echo Webserver is starting please wait...
    echo Waiting 5 seconds before next check.
    for /l %%r in (1,1,5) do @ping 127.0.0.1 -n 2 -w 1000 > nul
    goto startWebServerStat

I would apreciate any help,
Thanks.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros