title: How to check if a WildFly Server has started successfully using command/script?
body: <p>I want to write a script to manage the WildFly start and deploy, but I'm having trouble now. To check if the server has started, I found the command </p>
  
  <p><code>./jboss-cli.sh -c command=':read-attribute(name=server-state)' | grep running</code> </p>
  
  <p>But when the server is starting, because the controller is not available, <code>./jboss-cli.sh -c</code> fails to connect and returns an error.</p>
  
  <p>Is there a better way to check whether WildFly started completely?</p>