I have a bash code that, at the end of some installations, should automatically open a browser window with a URL (myapp.com) passed as a parameter. A php configuration page is displayed, confirming that everything has been installed correctly and after 30 seconds this window should close automatically, install a few more things (among them laravel) do the whole configuration and open another window again, showing the start page of Laravel.
Bash stops in the process of opening the browser and does not end. Following this POST , what I have so far is the following code:
...
PRJ_URL = 'myapp.com'
...
firefox $PRJ_URL & PID='jobs -p'& sleep 30s & kill $PID #OK-mostra a página do phpinfo() corretamente
... #instala mais algumas coisas
... #instala Laravel no folder desejado e configura as permissões
firefox $PRJ_URL #OK-mostra a página inicial do Laravel
Everything is working as expected. The only thing I can not do is close the browser in the first process automatically as it should with kill $PID
.
Where am I going wrong?