I'm using a keycloak server, when I run this command:
standalone.sh
This command launchs the server and I'm not able to stop it until I execute Ctrl-C command. I though about runing an instruction like this:
standalone.sh && jboss-cli.sh -c --commands=shutdown
or
standalone.sh ; jboss-cli.sh -c --commands=shutdown
Based on this question What are the shell's control and redirection operators? I found that ;
Will run one command after another has finished, irrespective of the outcome of the first.
And &&
Used to build AND lists, it allows you to run one command only if another exited successfully.
But in my case the first task did not exit and still executing. Is there any solution to run another task which will stop the first?
&
? Runningstandalone.sh &
will run it in the background, so you will still have access to the terminal and can runjboss-cli.sh -c --commands=shutdown
whenever you want. – terdon Mar 05 '18 at 13:31