How to run two java programs from bash.sh file

I need to make bash file which should run something like this:

cd /opt/selenium-server/

java -jar selenium-server-standalone-3.141.59.jar -role hub

java -jar selenium-server-standalone-3.141.59.jar -role node -hub http://173.249.58.30:4444/grid/register/

The problem is that if I run first java -jar command is starts running process which is still running and the second java command does not run till the first process is running.

How can I run both commands so the second one starts after the first service is running? May be this is complete wrong way to run Selenium server, but I did not find anything better. Thanks.


Go to Source of this post
Author Of this post: Čamo
Title Of post: How to run two java programs from bash.sh file
Author Link: {authorlink}