Use bash. Check with jboss-cli whether server is running instead of scanning the logfile