Hi mbertrand
I think this might work:
#!/bin/sh
Timeout=10
until ps | grep YourApplicationsName | grep -v grep
do
sleep 1
let "Timeout -= 1"
[ $Timeout -le 0 ] && break
done
A brief explanation of what it does (or should do, did not test it):
The ps command returns a list of processes currently running. Once your app starts, it will be listed.
The first grep command searches for your apps name and the second grep command filters out results containing
the word grep, since running grep adds it to the list of processes.
The commands between do and done will execute until your app starts.
The variable Timeout is decrement by one each time through the loop. When it hits zero, you drop out of the loop.
You can test Timeout later in your script to determine if your app started or you just timed out.